When my javascript code is contained in a HEAD block in my HTML file, it seems I can't set a breakpoint on it to debug it.
How can I do this?
alt text http://www.deviantsart.com/upload/mhmbha.png
this is what I see under the script tag:
alt text http://www.deviantsart.com/upload/17g116c.png
alt text http://www.deviantsart.com/upload/irki5p.png
alt text http://www.deviantsart.com/upload/mts9hn.png
Odd: when I take the javascript block OUT of my HTML <head>
area, then the .htm page appears under scripts (kind of counter-productive):
alt text http://www.deviantsart.com/upload/5rfia.png
ok, the only solution I can find to this question is to put my HEAD scripts back into a .js file, anyone have a way to debug inline javascript?
Use the sources tab, you can set breakpoints in JavaScript there. In the directory tree underneath it (with the up and down arrow in it), you can select the file you want to debug. You can get out of an error by pressing resume on the right-hand side of the same tab.
Inline JavaScript can be achieved by using Script tag inside the body of the HTML, and instead of specifying the source(src=”…”) of the JavaScript file in the Script tag, we have to write all the JavaScript code inside the Script tag.
Start debugging Set the breakpoints in the JavaScript code, as required. Open the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>.
In JavaScript, inline function is a special type of anonymous function which is assigned to a variable, or in other words, an anonymous function with a name.
You should search for your code in the Script tab, you can't set breakpoints in the HTML tab.
Edit: In your second screenshot, you are looking the code of the Google JS API file, you can either, change the file manually (the red square at left on my screenshot), or use the search-box at the right:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With