简体   繁体   English

IE9中的jQuery快速搜索

[英]JQuery Quicksearch in IE9

I have a page with a large table that uses jquery quicksearch to quickly search the table. 我有一个带有大表的页面,该页面使用jquery quicksearch快速搜索该表。 This function as written works fine in Chrome, FF, and IE8 but in IE9 it fails. 书面形式的此功能在Chrome,FF和IE8中工作正常,但在IE9中失败。 In fact it seems to fail in such a way that the remaining portion of the $(document).ready() doesn't complete. 实际上,它似乎失败了,导致$(document).ready()的其余部分没有完成。 Any ideas on what I can change in order to get this working in IE9? 关于可以更改哪些内容以使其在IE9中起作用的任何想法?

$(document).ready(function () {
            $("#search_box").quicksearch("table#invTable tbody tr", {
                noResults: '#noresults',
                stripeRows: ['odd', 'even'],
                loader: 'span.loading',
                onAfter: function() {
                    document.getElementById("count").innerHTML=($('tr:visible').length-1);
                    }                   
                });

EDIT: It looks like this error in the IE9 console is the problem: 编辑:看起来IE9控制台中的此错误是问题:

SEC7112: Script from https://raw.github.com/riklomas/quicksearch/dev/jquery.quicksearch.js was blocked due to mime type mismatch SEC7112:由于mime类型不匹配,来自https://raw.github.com/riklomas/quicksearch/dev/jquery.quicksearch.js的脚本被阻止

Now I just have to figure out how to fix it! 现在,我只需要弄清楚如何解决它!

EDIT2: File is hosted locally works. EDIT2:文件在本地托管作品。 To the commenter who suggested this - add it as an answer and I'll mark it correct. 对于提出此建议的评论者-将其添加为答案,我将其标记为正确。

The Github-hosted version of this JavaScript file comes down with the text/plain mime-type. 这个JavaScript档案的Github代管版本是text/plain mime-type。 If you were to host the file locally you wouldn't have this problem, as the content-type would be text/javascript . 如果要在本地托管文件,则不会出现此问题,因为content-type是text/javascript The same rule applies for CSS as well. 同样的规则也适用于CSS。

Further reading: MIME-Handling Changes in Internet Explorer 进一步阅读: Internet Explorer中的MIME处理更改

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM