I am using the "with" binding in knockout.js, and it works fine below in say Chrome and IE9, but when I move to IE8 the form doesnt submit anymore. I remove the "with" it does just fine. In Visual Studio the "with" keyword is blue telling me it's a reserved word. Is there anyway around this for IE8?
<form class="box clearfix" action="@Request.RawUrl" data-bind="with: members.events, form: { id: @Model.Event.Id }">
ko.bindingHandlers.form = {
init: function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
$(element).find('button[type=submit]:last').click(function () {
if (typeof (value.submit) == 'function') {
value.submit();
} else {
app.call({
type: 'POST',
data: $(element).serializeObject(),
url: $(element).attr('action'),
success: function (result) {
if (value.replace) {
app.updateContainerWithHtml(result);
} else {
if (value && value.id == 0 && typeof(result) == 'string') {
window.location.hash = result;
} else {
if (typeof (value.callback) == 'function') {
value.callback(result);
}
}
if (value.hideSuccess == undefined && !value.hideSuccess) {
if (result.Url) {
app.showSuccess(result.Message, function() {
window.location.hash = result.Url;
});
} else {
app.showSuccess();
}
}
}
}
});
}
return false;
});
}
};