How to debug scripts in Firebug?
I could never view a script correct开发者_如何学运维ly in Firebug,every one of them is displayed in one line.Like shown on the image below:
http://img716.imageshack.us/img716/1126/54274507.png How do I view it correctly so I could debug it?
Thank you in advance!
This script has been minified by removing all extraneous whitespace.
You cannot easily debug such scripts.
Scripts that you write yourself and that are not minified or compressed will appear on normally on multiple lines and can be debugged.
For your own scripts, simply call:
console.log(someObject);
I usually hang around the "Console" tab, and see which errors or logged items come in, or use the console itself to type in code I want to run.
I never use the "Script" tab.
If you just want to view the code nicely, use a beautifier:jsbeautifier.org
Script writers minify and often change variable names to difficult alphanumeric names, basically wanting the script to be least human readable so that no one copies their code/logic, as one can easily do that using firebug and similar stuff. such scripts can be a real pain to debug and there are very few chances that you will be able to understand this one. All the best with the task anyhow.
have you tried debugging it anyhow by having a breakpoint on this only available line ?
精彩评论