开发者

Why do I get no source for error in Firefox

The Firebug console gives me:

------------------------------------------
(X) 0
    no source for No element with id 'inline_gallery_image_false' found)
------------------------------------------

When I click this error I get a blank source view window. The 'Stack' pane in the Script tab turns up blank as well.

Firefox 3.5.5 + Firebug 1.4.5. All other extensions are disabled.

I've turned on 'Stop on All Errors' and 'Show Javascript Errors' and 'Show Stack Trace on Errors' but all I get is the error shown above. Strangely a Google search turned up nothing he开发者_StackOverflow中文版lpful.

Basically I know the error is due to a bad argument passed to a function in an external JS file but I want to know what function called it and how it came to send the wrong argument. I also want to know why it won't show the source or even tell me which file the error is in.


If you know what you do to repeat the error, then just put a breakpoint in that section, and just start to step through. At some point you will be jumped completely out of your code, or it will just exit, but you will begin to figure out what happened to cause the error.

It appears that you are trying to access an element that doesn't exist, or is not in the DOM, yet. You may have tried to create an element with setting innerHTML but you haven't given the browser to make the DOM change yet.

Can you explain what is going on when this happened? What are you trying to do, what do you expect to happen?


I noticed the standard Firefox console gives the same error so this issue is not an issue with Firebug after all. When I click the error to view source I get:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.loadURI]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://global/content/viewSource.js :: viewSource :: line 221"  data: no]

UPDATE: After searching around I found another site with a JS error. Upon opening source view I get a blank page and:

Error: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIRequest.name]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: file:///D:/Apps/Firefox3.5/components/nsLoginManager.js :: anonymous :: line 328"  data: no]
Source File: file:///D:/Apps/Firefox3.5/components/nsLoginManager.js
Line: 328

Seems pretty clear some extension or plugin has screwed up my FF source view. I'm going to reinstall from scratch. Since it's clear this isn't a programming issue any more feel free to close.

UPDATE: Turned out it WAS a programming error. The offender was this line of code:

if (isStrict && !o) throw new Error(0,"No element with id '" + ref + "' found");

WTF is that 0 in there? No idea. I must have followed a dodgy tutorial because when I looked into the Error constructor the first argument is supposed to be the message string. The second argument is supposed to be the URL of the offending file (optional) so FF rightly thought there was an error called '0' in the file "No element with ...".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜