【发布时间】:2018-06-20 16:13:58
【问题描述】:
我有一个 AJAX 调用,每次在 Mozilla 和 Chrome 中都会触发,但不是 IE11。想法表示赞赏。
function getOrders(customerId) {
alert('Test1');
$.ajax({
type: "GET",
url: '/Orders/GetOrders',
data: ({ customerId: customerId}),
dataType: 'html',
success: window.updateTable
});
alert('test 2');
}
【问题讨论】:
-
使用
$.ajax的cache: false属性:api.jquery.com/jQuery.ajax -
或者只是添加未使用的随机数据。
-
只是其他一些建议,不要使用
alert()进行调试。console.log()是更好的实践和准确的。此外,您提供给data的对象也不需要括号 -
谢谢大家。喜欢缓存:错误的想法。
-
也感谢您提供有用的 JS 建议
标签: javascript jquery ajax internet-explorer