9

I have a script to handle window.onerrors and push it to my server. I see some "Error Loading Script" errors that happen only in Firefox.

I searched around and people were ignoring "Error loading Script" errors. For example

  1. Cryptic "Script Error." reported in Javascript in Chrome and Firefox
  2. Firefox: "Error loading script"

Can these errors be safely ignored like the above? Or should I ignore only in Firefox?

5
  • 2
    What do you mean by "safely ignored"? I would say that in general, an error loading a script is a problem with your code (e.g. URL for script is incorrect, perhaps it is a computed URL and the code to compute it is wrong, etc) and you should log these, but if there is some valid reason why sometimes the script would not load in some circumstances, then perhaps you can ignore them. I'm also not sure what you mean by "ignore only in Firefox" -- are you saying that the scripts load correctly in other browsers? Commented Oct 17, 2014 at 5:30
  • 1
    Is the URL to the script over HTTPS? I've seen this error happen due to SSL certificate issues. Commented Oct 29, 2014 at 15:42
  • 2
    You're not provided enough information to answer your question. This could be caused by cross-domain security limitations, a problem with your code, or a portion of one of the included scripts interrupting script load. That means that it may be okay to ignore if and only if you know what is causing the error, and you know that resulting behavior will not impact your work. In general however, it is bad practice not to address errors of an unknown cause. Commented Oct 29, 2014 at 21:12
  • possible duplicate of Firefox: "Error loading script" Commented Nov 14, 2014 at 11:21
  • If you've got an error that you don't understand, then ignoring it is probably going to give you bigger problems further down the line. But ultimately, it depends how important the script that is failing to load is to your site -- if it's a key part of your functionality, then things are going to break without it. If it's something like a third party advertising or tracking library that doesn't interact with anything else then you may be safe ignoring it, although of course you'd lose the benefits of any advertising or tracking that it should be doing for you. Commented Aug 8, 2015 at 20:25

2 Answers 2

0

If by ignoring you mean hiding, yes, probably.

Just quote you code like this:

try {

    // put code that produce error

}
catch( error ){

    // console.log(error);

};

Hiding error is probably not the better solution for your problem...

Sign up to request clarification or add additional context in comments.

Comments

0

"Error loading script" is not reported via window.onerror in Firefox 14+: MDN, Bugzilla.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.