jQuery加载耗时过多

编程入门 行业动态 更新时间:2024-10-10 02:15:01
本文介绍了jQuery加载耗时过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们正在使用tomcat和MySQL v5.5.24开发一个站点.该网站可以在Chrome上正常运行,但是Firefox和IE会在页面加载20秒钟后始终阻止javascript. Firefox的每个页面(至少来自本地主机)都需要20秒才能加载不同的资源(css/js/image). 问题在于它每次都不都是相同的脚本.可以是任何随机的 虽然在Firefox上,其他站点也能正常工作.附件是来自firefox的时间轴 ![在此处输入图片描述] [2] 使用Chrome加载时,同一页面的加载时间不到1秒.附件是来自Chrome的时间轴.

We are developing a site using tomcat and MySQL v5.5.24. Site works fine on Chrome, however Firefox and IE are blocking javascript consistently for 20 secs on page onload. Every page on firefox from localhost minimum takes 20secs to load for different resources (css/js/image). Problem is that it is not the same script every time. It could be any random Other sites works fine though on firefox. Attached is timeline from firefox ![enter image description here][2] Same page when loaded using Chrome is loading under 1sec. Attached is timeline from Chrome.

推荐答案

我们在web.xml中有此代码,这是导致问题的原因.

We had this code in web.xml which was causing the problems.

<filter> <filter-name>2WayFilter</filter-name> <filter-class>com.osmoticweb.gzipfilter.GZIP2WayFilter</filter-class> </filter> <filter-mapping> <filter-name>2WayFilter</filter-name> <url-pattern>*.js</url-pattern> </filter-mapping>

一旦我们将其取出,情况就恢复正常了.

Once we took this out, things were back to normal.

更多推荐

jQuery加载耗时过多

本文发布于:2023-10-26 06:32:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529358.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!