Malcolm
Malcolm

Reputation: 12864

How to debug in Firebug when code is in separate JS file?

I am starting out with Firebug.

I have a JS file that has some JQuery in it.

how do I debug that code when the HTML page rendered does not have any javascript just ref to my file.

thanks Malcolm

Upvotes: 8

Views: 6154

Answers (4)

Alex
Alex

Reputation: 36586

In the new firebug you need to click on the file list to get access to external js files. It is no longer in the "Script Tab". Once you've changed to the js file you want to set the breakpoint in you just need to click the line number on the left and reload the page.

alt text http://rival-studios.com/Portals/0/so-firebug.gif

Upvotes: 2

Kirtan
Kirtan

Reputation: 21695

You can add "debugger;" string before the line which you want to debug.

This will invoke Firebug's JS debugger.

Upvotes: 3

B.E.
B.E.

Reputation: 5080

Open Firebug. Click on "Script" then choose your external JS-File from the dropdown menu.

Upvotes: 4

CurtainDog
CurtainDog

Reputation: 3205

If you go to the script tab there'll be a little drop down box that will you let you select any scripts linked to in the page. Won't help you much if they're minified though...

Upvotes: 6

Related Questions