We normally debug the javascript files like .js by having breakpoing in firebug , is there any way to debug inline javascript inside the page.
We have lot of inline code in the page itself with , let me know if there any efficent way of debugging.
Thanks
You can also use firebug to debug the javascript between your <script> tags.
Related
On a webpage I have a "onclick" event in a <div> element. Right clicking it on Firefox and inspecting it brings up the dev console. At this point I see the function it is being called but I'm unable to lookup the code or the file that this function is pointing to, what am I missing?
The body of the javascript function can be found in respective .js library. In developer's tool, click the tab "Debugger". It lists all .js files which might contain the function you are looking for.
Just found the answer while trying, it seems I were using # rather than # which is used to lookup a function definition!
Have you tried firebug add on for Firefox?
I think it is clearer to see it with firebug. I'm sorry if it's not what you are looking for, because i can't suggest it on comment
The scripts on our website are embedded in the html and everything is minified. Throwing a debugger statement into the javascript to debug doesn't help very much because there's only actually one line of html in the original source. When the source is prettified with Chrome's code prettifier, the debugger points to the wrong line in the code.
How can I debug minified javascript embedded in the html?
One thing that might help is that you can set breakpoints in chrome w/o using the debugger directive directly in code. Simply view the prettified code output in the chrome sources tab, and then double click on the line where you want to add a breakpoint.
I'm not that familiar with IE-10 and I'm trying to troubleshoot some code using the F12 tools. I can't find a way to debug ( i.e. set break points, etc. ) in a script that is Ajaxed in, and then append to the DOM.
I can download it more conventionally using <script> but not changing things would be a bit easier. Is there a way to do this?
The simplest way I can think of would be the temporarily add a debugger; command at the top of the dynamically added script file. That will cause it to drop into the debugger as soon as that script starts to execute. Once it drops into the debugger, you can set breakpoints in the now-loaded script that hasn't yet executed.
I'm wondering if it is possible to step through HTML and JavaScript Code in VS2010 ? I have a project in which I have an HTML file with Javascript inside it...I can't set a breakpoint on the HTML and although I can set a breakpoint on the Javascript it will not pause when I run the project.
Thanks
you can't debug HTML. If you want to debug javascript code that is embedded in the HTML, add a line
debugger;
inside the script tag. The browser will stop and let you debug it from there
As far as i know, you can't set breakpoints in/on HTML code, why would you. You can step through JavaScript code in IE, if you allow debugging of client scripts in the internet options of IE. For any other browser you will need some other JavaScript-debugger, something like Firebug.
If you are sure you have the javascript debugger attached, you can put a simple debugger; statement in your js which will cause it to break. You will have to have script debugging turned on an VS attached to your IE process. You could also use the IE Dev Tools JS debugger.
I am trying to make a simple Safari 5 Extension that just injects a custom javascript. Any ideas how can I make use of jQuery in this custom script, please? I only know it's possible, because it is mentioned on one of WWDC videos, but I don't know how to do it.
Thanks
You can include jquery.js as a "start script". Your regular script (as an "end script") will see it.
I believe that if you don't need to keep jQuery updated, just copying the source code of jQuery into your extension's code base should work.