日期:2014-05-16  浏览次数:20278 次

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

最近遇上个非常诡异的问题:在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
?

修改后问题解决!

?

相当之无语

?