简体   繁体   English

为什么此jQuery在IE中不起作用,但在其他所有浏览器中都起作用?

[英]Why does this jQuery not work in IE but in every other browser?

My question is why this code is working in all browsers except of IE function. 我的问题是,为什么此代码可在除IE功能之外的所有浏览器中正常工作。 In the other browsers it works. 在其他浏览器中也可以。

if (phrases.indexOf(currentPhrase)) phrases.splice(phrases.indexOf(currentPhrase), 1); if(phrases.indexOf(currentPhrase))短语.splice(phrases.indexOf(currentPhrase),1);

My guess is that IE is caching the request (since it's through GET ). 我的猜测是IE正在缓存请求(因为它是通过GET )。 You can fix this in a bunch of ways including cache-control on the server side or using POST instead. 您可以通过多种方式解决此问题,包括在服务器端进行缓存控制或改用POST jQuery's .load() is a bit annoying in that you have to use an object as data to indicate you want a POST request and use a string for GET instead of allowing you to set an explicit request. jQuery的.load()有点烦人,因为您必须使用一个对象作为数据来表示您想要POST请求,并为GET使用字符串,而不是允许您设置显式请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么这个简单的代码在firefox中失败,但在包括Opera和旧IE版本在内的所有其他浏览器中都可以使用 - Why does this simple code fail in firefox yet work in every other browser including opera and old IE versions jQuery可以在除IE之外的所有浏览器中使用 - Jquery works in every browser other than IE 将以下JQuery放在网站上时,为什么以下JQuery在IE浏览器上不起作用? - Why the following JQuery does not work on IE browser when I put it in my website? 为什么 html() function 在 JQuery 在 IE 中不起作用 - Why html() function in JQuery does not work in IE 为什么JQuery在IE和FireFox中不起作用? - Why does JQuery not work in IE and FireFox? 为什么jQuery .attr()在IE9中不起作用? - Why does not jQuery .attr() work in IE9? IE7正则表达式问题 - 在每个浏览器中工作的正则表达式在ie7中不起作用 - IE7 regex issue - Regex that work in every browser does not work in ie7 为什么直通仅适用于此jQuery待办事项列表上的所有其他项目? - Why does line-through work only for every other item on this jQuery to do list? 为什么这个网站会冻结在IE 7中,而不是在任何其他浏览器中? - Why does this website freeze in IE 7 but not in any other browser? jQuery .clone()方法在IE和Chrome浏览器中不起作用 - Jquery .clone() method does not work in IE and Chrome Browser
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM