jquery ui自动完成在ie8中不起作用(直到页面刷新) [英] jquery ui autocomplete not working in ie8 (until page refresh)
问题描述
我正在使用jquery ui自动完成它在除了ie8之外的所有浏览器中都能正常工作。
I am using jquery ui autocomplete it is working absolutely fine in all browsers except ie8.
我一直在做一些测试,似乎有一个奇怪的错误。当我点击指向相关页面的链接时,当我开始在自动填充框中输入时,ie8会生成以下错误:
I have been doing some testing and there seems to be a strange bug. When I click on a link leading to the relevant page there is the following error generated by ie8 when I start typing in the autocomplete box:
'对象不支持此属性或方法'
此错误指向我在4955行的开发jquery(1.4.2)文件,char 5是以下行:
return new window.XMLHttpRequest();
'object doesn't support this property or method' this error points to my development jquery(1.4.2) file at line 4955, char 5 which is the following line: return new window.XMLHttpRequest();
但是,如果我只是重新加载页面,则自动完成工作正常。
However, if I simply reload the page the autocomplete works.
我添加了一个随机数据要调用自动完成,因为我读到ie8缓存它ajax获取请求,但这似乎没有解决问题。
I have added a random bit of data to be called with the autocomplete as I read that ie8 caches it ajax get requests but this does not seem to have solved the problem.
加载时间是否有问题相关文件包括jquery?如果是这样,我该如何解决这个问题呢?
任何其他聪明的想法?!
Could there be a problem with the timing of the loading of all the relevant files including jquery? If so, how would I fix this? Any other clever ideas?!
Andy
推荐答案
经过大量的反复试验后,我发现答案非常简单!
After lots of trial and error I found the answer to be very simple!
我正在调用元标记...
I was calling the meta tag...
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
...在javascript包含文件之后。除了IE8之外的所有其他浏览器都允许这样做。
...after the javascript include files. All other browsers except IE8 allowed this.
这将是一个我不会很快忘记的教训 - 花了很多时间修复!
That'll be a lesson I won't forget soon - many hours spent fixing!
这篇关于jquery ui自动完成在ie8中不起作用(直到页面刷新)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!