No Javascript on this page

4,046 views
Skip to first unread message

Orthoducks

unread,
May 28, 2012, 7:39:07 PM5/28/12
to Firebug
I tried to debug some code today, Firebug's Script pane confronted
me with this message:

No Javascript on this page

If <script> tags have a "type" attribute, it should equal "text/
javascript" or
"application/javascript". Also scripts must be parsable
(syntactically correct).

I looked this up on the Web and found that it means exactly what it
says, except that it can also be caused by a <script> tag that does
not specify type="text/javascript".

All of my scripts do specify type="text/javascript".

Where was the problem? Well, if Firebug wouldn't tell me, how was I
supposed to find it?

I began a long session of debugging by elimination. After ruling out
every bit of JavaScript my script uses -- including the parts that
hadn't changed since the script worked or were used in other scripts
that didn't have the problem -- I went to work on my script's main
file.

That was insane, because the main file contains no JavaScript at all
-- only references to include files that I'd already cleared. But it
worked! When I eliminated the entire body of the script, FireBug
worked correctly.

I then started putting stuff back in, expecting to zero in on the bit
of code that was getting Firebug upset.

Wrong. I eventually reinserted the entire script, leaving it exactly
as it was when I started, and Firebug continued to work correctly.

Now I can begin debugging my script, after a couple of hours of
totally unproductive problem identification.

I hope someone can explain what happened here, and how to prevent a
repeat. Firebug is a great tool when it works, but when it does things
like this it ceases to be Firebug, and becomes just plain Bug.

Sebastian Zartner

unread,
Jun 1, 2012, 5:00:31 AM6/1/12
to fir...@googlegroups.com
I looked this up on the Web and found that it means exactly what it
says, except that it can also be caused by a <script> tag that does
not specify type="text/javascript".
That's incorrect. Firebug also displays the script when you don't specify the type attribute.

I went to work on my script's main file.

That was insane, because the main file contains no JavaScript at all
-- only references to include files that I'd already cleared. But it
worked! When I eliminated the entire body of the script, FireBug
worked correctly.
I assume with "main file" you mean your HTML file? And by "references to include files" you mean <script src="xyz.js" type="text/javascript"></script>, no?

I then started putting stuff back in, expecting to zero in on the bit
of code that was getting Firebug upset.

Wrong. I eventually reinserted the entire script, leaving it exactly
as it was when I started, and Firebug continued to work correctly.

Now I can begin debugging my script, after a couple of hours of
totally unproductive problem identification.

I hope someone can explain what happened here, and how to prevent a repeat.
The only explanation I have is that you didn't put it back in exactly as it was before. E.g. a simple typo in your <script> tag won't load the file. Or you had a syntax error in your file before, which also won't let you see the script inside the Script panel.
Since it's working again now, we unfortunately don't have a test case for this to check out what went wrong.

The next time this occurs, your first sight should go to the Net panel to see if the script was really loaded correctly. If it was, you should have a look inside the Console panel for any syntax errors your code might have. If there's nothing listed, confirm this via the Firefox Error Console.
If it was loaded correctly and works fine, but the Script panel still claims that there is no JavaScript on the page, then probably something weird is going on.
In that case please contact us again before you change anything on your script. If it's possible you should send us that files or somehow give us access to them, so we're able to reproduce the problem on our machines. Without a reproducible test case we can just guess what's wrong.

Sebastian

pedz

unread,
Jul 1, 2012, 12:41:05 PM7/1/12
to fir...@googlegroups.com
This just happened to me as well.  In my case, I was debugging happy and content.  Then I started getting this message.  This may or may not help but on the Mac, a three finger swipe will go back a page.  I did that by accident.  When I clicked forward, I started getting the "No javascript" (described above) message.  I tried refresh and shift/refresh, dancing a polka, etc. No change.

When I saw this post, I decided to just quit Firefox and restart it.  That solved my problem.

Sebastian Zartner

unread,
Jul 2, 2012, 1:27:12 AM7/2/12
to fir...@googlegroups.com
This just happened to me as well.  In my case, I was debugging happy and content.  Then I started getting this message.  This may or may not help but on the Mac, a three finger swipe will go back a page.  I did that by accident.  When I clicked forward, I started getting the "No javascript" (described above) message.  I tried refresh and shift/refresh, dancing a polka, etc. No change.

When I saw this post, I decided to just quit Firefox and restart it.  That solved my problem.
Which version of Firebug do you use? I assume you also can't give a precise test case for this?

Sebastian

Sebastian Zartner

unread,
Jul 2, 2012, 1:58:07 AM7/2/12
to fir...@googlegroups.com
I think I found a test case for this problem. Therefore I created issue 5646. Please let me know if that's the same as you're seeing.

Sebastian
Reply all
Reply to author
Forward
0 new messages