我们正在从.cache.html文件加载javascript,那么为什么我们无法从.js下载它?

时间:2012-11-26 07:06:33

标签: javascript gwt

我在研究gwt时看到了developers.google.com中的以下句子。

"The "`cache`" files contain your application's logic. If you were to look inside a 
`.nocache.html` file, you would see that it is JavaScript code wrapped in a thin HTML
 wrapper.You might wonder why the `GWT` Compiler doesn't simply emit it as a JavaScript .js 
file. The reason for this is that certain browsers do not correctly handle compression of 
pure-JavaScript files in some circumstances. This would effectively mean that users 
unfortunate enough to be using such a browser would download the `.js` file uncompressed. "

我们从.cache.html文件加载javascript, 那我们为什么不能从.js下载呢?我认为现在所有浏览器都支持javascript ..

1 个答案:

答案 0 :(得分:1)

引用的声明似乎已经非常清楚地解释了这一点:“在某些情况下某些浏览器无法正确处理纯JavaScript文件的压缩”。关于支持JavaScript,它是,它是关于支持JavaScript文件的压缩。