Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance bootsrap js减慢IE中的网页速度_Performance_Internet Explorer_Twitter Bootstrap_Slowdown - Fatal编程技术网

Performance bootsrap js减慢IE中的网页速度

Performance bootsrap js减慢IE中的网页速度,performance,internet-explorer,twitter-bootstrap,slowdown,Performance,Internet Explorer,Twitter Bootstrap,Slowdown,我已经在我的网站上使用twitter引导开发了一个页面。 在这一点上,我已经包括了下面提到的bootstrap的js bootstrap-transition.js bootstrap-alert.js bootstrap-modal.js bootstrap-dropdown.js bootstrap-scrollspy.js bootstrap-tab.js bootstrap-tooltip.js bootstrap-popover.js bootstrap-button.js boots

我已经在我的网站上使用twitter引导开发了一个页面。 在这一点上,我已经包括了下面提到的bootstrap的js

bootstrap-transition.js
bootstrap-alert.js
bootstrap-modal.js
bootstrap-dropdown.js
bootstrap-scrollspy.js
bootstrap-tab.js
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-button.js
bootstrap-collapse.js
bootstrap-carousel.js
bootstrap-typeahead.js
此页面在FF和chrome中运行良好。 当我在IE中打开该页面并选中任何复选框时,选中/取消选中该复选框需要一些时间。 在dtropwown中也会发生同样的情况,展开/折叠下拉列表需要一些时间

所以我一个接一个地删除了所有的引导js,它开始提高性能。 当所有的bootstrap js都被移除后,它开始和其他浏览器一样工作正常

那么有什么解决办法吗


提前谢谢。

我怀疑JS的数量是否会让你慢下来。例如,当你点击按钮时,你是否也会得到同样糟糕的表现?我不是

相反,我怀疑您可能与其他JS库存在冲突,或者您的标记格式不正确,这导致一个引导插件将异常数量的回调附加到页面

测试后者的一种方法是修改
jQuery.on
以在调用时打印到控制台。在jQuery加载之后,但在引导库之前运行以下命令可以实现此目的:

var old = jQuery.fn.on;
jQuery.fn.on = function (types) {
  console.log(types);
  return old.apply(this, arguments);
};
在Bootstrap文档中,有50个已注册的侦听器,大部分是单击


否则,在JS的数量上,您应该使用一个聚合的、缩小的引导版本,比如services(),而不是所有这些单独的文件。使用开发中的资源;在性能测试/生产中使用缩小版。

我在应用程序中使用了
jquery-1.8.1.min.js

我通过将
jquery-1.8.1.min.js
替换为
jquery-1.8.3.min.js

现在它在包括IE在内的所有浏览器中都可以正常工作