如何在firebug中调试最小化的JS? [英] How can I debug a minified JS in firebug?

查看:92
本文介绍了如何在firebug中调试最小化的JS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个包含疯狂数量的最小化的JS文件的网页。网页在我的本地网络上工作得很好,但在分段上会抛出一些JS错误。 JS中有一个问题,我不会调试它。当我在Firebug的脚本标签中加载JS时,会出现在一条长的水平线上。在Firebug中有没有出路可以扩展或美化脚本进行调试?我知道我可以使用jsbeautifier,但他们不会帮助我。我无法将扩展的文件上传到CDN,不符合使用CDN的目的。


I have a web page which includes insane amount of minified JS files. The web page works perfectly fine on my local network but throws some JS error on staging. There is an issue in JS and I wan't to debug it. When I load the JS in Firebug's script tag it appears in one long horizontal line. Is there a way out in Firebug that expands or beautifies the script for debugging? I know I can use jsbeautifier but they wont help me. I can not upload an expanded file to CDN, defeats the purpose of using CDN.

要注意的点,

a)我无法控制盒子,它提供JS,它的CDN,我提到它。

b)我可以使用美化器等,但这将帮助我在运行时调试脚本? IMHO,no

c)受NDA和其他法律事务的束缚,我无法共享脚本,但它是一个通用问题,您可以使用一个经过精简的jQuery

Points to be noted,
a) I can not control the box which serves JS, its on CDN, I mentioned it.
b) I can use beautifiers etc but would that help me in debugging the script in run time? IMHO, no
c) Being bound by NDA and other legal things I can not share the script but its a generic problem, you can encounter it with a minified jQuery

推荐答案


  1. 美化您的脚本

  2. / etc / hosts 中添加CDN主机或您的本地DNS将其解析为您自己的网络服务器

  3. 托管美化版本以及所需的所有Web服务器

  4. Firefox和Chrome(版本为此编辑)支持美化脚本,并带有检查器中可用的 {} 按钮。

  1. Beautify your script
  2. Add the CDN host in /etc/hosts or your local DNS to resolve it to your own web server
  3. Host the beautified version and everything that you need on said web server
  4. Both Firefox and Chrome (versions as of this edit) support beautifying script with the {} button available in the inspector.

这篇关于如何在firebug中调试最小化的JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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