我正在使用Knockout JS,并有以下方法,使一个 AJAX 调用。最近我注意到一个控制台错误Expected ':'
,发生在Internet Explorer 11。这在Chrome中工作正常。有什么特别的IE不能正确处理这里?
app.getAutoGeneratedSubmissionAttachments = function (carrierId, employerId, formId, submissionTypeId, IsMedical, IsDental, IsLife, IsVision, callBack) {
$.ajax({
url: $('#GetAutoGeneratedSubmissionAttachments').data('url'),
type: 'GET',
dataType: 'json',
data: { IsMedical, IsDental, IsVision, IsLife, carrierId: carrierId, employerId: employerId, formId: formId, submissionTypeId: submissionTypeId },
success: function (data) {
callBack(data);
},
fail: function (data) {
$.unblockUI();
toastr.error("An error has occured on the server when retrieving additional submission documents.");
}
})
}
1条答案
按热度按时间5sxhfpxr1#
速记对象属性(例如:
let o = {a, b, c}
)是ES6功能,在IE11上不受支持https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer
https://caniuse.com/#search=es6
若要修正此问题,请将数据变更为使用标准
key: value
表示法。