JQUery 自动完成器在 IE8 中无法正常工作
我有一些脚本可以在 Firefox 和 Chrome 中运行,但在 IE 8 中我收到此错误:
$.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, //the following line throws the error, read down for error message formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>])(" + term.replace(/([\^\$()[]{}*.+\?\|\])/gi, "\$1") + ")(?![^<>]>)(?![^&;]+;)", "gi"), "$1"); }, scroll: true, scrollHeight: 180 };` the specific error reads: '0' is null or not an object
我可以将 row[0] 更改为其他内容吗?这是在 jquery.autocomplete.js 中找到的,它在 Firefox 中读取相同的内容并且不会导致错误,所以如果可能的话,我真的不想更改它。
任何建议都会有帮助谢谢!
I have some script which is working in firefox and chrome but in IE 8 I get this error:
$.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, //the following line throws the error, read down for error message formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>])(" + term.replace(/([\^\$()[]{}*.+\?\|\])/gi, "\$1") + ")(?![^<>]>)(?![^&;]+;)", "gi"), "$1"); }, scroll: true, scrollHeight: 180 };
`
the specific error reads: '0' is null or not an object
can I perhaps change the the row[0] to something? This is found in jquery.autocomplete.js and it reads the same in firefox and doesn't cause the error, so i don't really want to change this if at all possible.
any advice would help thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我正在做的事情(基本上我使用了 formatItem 函数,但把它拿出来并尝试了你所做的,它有效
。HTH
This is what I am doing (basically I used formatItem function but took that out and tried what you did and it works.
HTH