论坛首页 Web前端技术论坛

IE6下动态加载JS数据不执行的诡异问题

浏览 8049 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-12-07   最后修改:2009-12-13

最近遇上个非常诡异的问题:在ie6下,从地址栏直接输入网址,或者从超链接打开的时候网页种动态加载的js数据不会执行。但是刷新下就ok。

 

后来才知道这又是ie6的一个bug:当该js数据是no-cache, no-store,并且是gzip压缩的时候就会出现这个问题。

 

修改前:

HTTP/1.1 200 OK
Date: Mon, 07 Dec 2009 10:40:20 GMT
Server: Apache
Cache-Control: no-cache, no-store, max-age=0, must-revalidate, max-age=0
Expires: Mon, 07 Dec 2009 10:40:20 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

 

 

修改web服务器配置后:

 

HTTP/1.1 200 OK
Date: Mon, 07 Dec 2009 10:57:56 GMT
Server: Apache
Cache-Control: max-age=0, must-revalidate, max-age=0
Expires: Mon, 07 Dec 2009 10:57:56 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 3396
Connection: close
Content-Type: text/html; charset=utf-8
 

修改后问题解决!

 

相当之无语

 

论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics