在IE6中打包/精简的javascript失败 - 如何调试? [英] Packed/minified javascript failing in IE6 - how to debug?

查看:166
本文介绍了在IE6中打包/精简的javascript失败 - 如何调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些文件,我结合和打包生成一个单一的,最小化的JS文件。问题是,当我将文件缩小(使用打包程序)时,IE6提供了其特色有用的功能错误消息。

 行:12 //当然,第12行是空行
Char:1
错误:预期')'
代码:0

事情是:它工作IE7,Firefox和Chrome中的IE浏览器的问题只出现在IE6上。



解压缩后,我有近200kb的脚本通过8个文件传播。如何解决这个问题?

解决方案

您是否已经验证了未分解的代码可以在IE6中成功运行?如果是这样,因为这是一个语法错误而不是运行时错误,我将采取的下一步是开始减少一半的JavaScript,将其缩小,并查看问题停止报告的时间。然后从那里继续二进制搜索。


I have a number of files which I combine and pack to produce a single, minified JS file. The problem is that when I minify the file (using packer), IE6 gives one of its characteristic helpful error messages.

Line: 12      // of course, line 12 is an empty line
Char: 1
Error: Expected ')'
Code: 0

The thing is: it works fine in IE7, Firefox and Chrome the problem only comes up for IE6.

Unpacked, I have almost 200kb of scripts spread through 8 files. How on earth do I fix this?

解决方案

Have you already verified that the un-minified code can run successfully in IE6? If so, because this is a syntax error and not a runtime error, the next step I'd take is start halving the javascript, minifying it, and seeing when the problem stops being reported. Then continue binary searching from there.

这篇关于在IE6中打包/精简的javascript失败 - 如何调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆