最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Firefox: "Error loading script" - Stack Overflow

programmeradmin2浏览0评论

"Error loading script" occurs under FireFox 3 if I "quickly click" different links on my web site (Asp.Net MVC + jQuery, full postbacks). It is rather easy task to reproduce this bug. But I cannot understand why it occurs? Every time it shows different failed script file. All JavaScript files are included before closing tag.

Errors are trapped in window.onerror handler. If I simply ignore errors with message 'Error loading script' everything works fine. But this seems to be not the best solution, there must be some reason. It's a pity but this post was not helpful for me: Firefox ‘Error loading script’ loading Google Analytics in FF2

Another resources that describe similar problem:

Browser Scripting Errors ...

Firefox 'Error loading script ' issue when implementing GA scripts.

There is error log entry:

Error message: "Error loading script"
Location.href: http://blah-blah-blah/General
Url: http://blah-blah-blah/Scripts/localization/locale-uk.js
Line: 1
UserAgent: mozilla, 1.9.0.11

Can you help me with this annoying bug? Thanks.

"Error loading script" occurs under FireFox 3 if I "quickly click" different links on my web site (Asp.Net MVC + jQuery, full postbacks). It is rather easy task to reproduce this bug. But I cannot understand why it occurs? Every time it shows different failed script file. All JavaScript files are included before closing tag.

Errors are trapped in window.onerror handler. If I simply ignore errors with message 'Error loading script' everything works fine. But this seems to be not the best solution, there must be some reason. It's a pity but this post was not helpful for me: Firefox ‘Error loading script’ loading Google Analytics in FF2

Another resources that describe similar problem:

Browser Scripting Errors ...

Firefox 'Error loading script ' issue when implementing GA scripts.

There is error log entry:

Error message: "Error loading script"
Location.href: http://blah-blah-blah/General
Url: http://blah-blah-blah/Scripts/localization/locale-uk.js
Line: 1
UserAgent: mozilla, 1.9.0.11

Can you help me with this annoying bug? Thanks.

Share Improve this question edited May 23, 2017 at 12:00 CommunityBot 11 silver badge asked Jul 6, 2009 at 15:08 RomanRoman 4,61110 gold badges45 silver badges71 bronze badges 3
  • Have you tried using Firebug's error console (the FF add-on)? It may provide a more information. – Dana the Sane Commented Jul 6, 2009 at 15:15
  • FireBug tells nothing, only window.onerror handler can detect this error – Roman Commented Jul 6, 2009 at 15:43
  • "Error loading script" is not reported via window.onerror in Firefox 14+: MDN, Bugzilla. – Nickolay Commented Aug 8, 2015 at 20:16
Add a ment  | 

2 Answers 2

Reset to default 2

If you're quickly clicking between links, you may simply be interrupting the load process of some of the GA scripts at different points (hence the randomness).

Perhaps when you do that and you get an error message, it may only apply to the page that was previously loaded.

This is clearly answered in a previous post already

Firefox 'Error loading script' loading Google Analytics in FF2

This problem occurs when leaving a page in Firefox before all scripts have finished loading. So I assume that it is safe to ignore the error.

You don't see this error in the Firefox error console, but you can make it visible by binding an alert to the window.onerror event. Then you will be able to see the alert box for a small amount of time and get the following error in the error console:

[11:35:57.428] uncaught exception: [Exception... "prompt aborted by user" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource:///ponents/nsPrompter.js :: openTabPrompt :: line 462" data: no] I'm using the following check to ignore this error in my onerror handler:

if (navigator.userAgent.search('Firefox') != -1 && message === 'Error loading script') { // Firefox generates this error when leaving a page before all scripts have finished loading return; }

发布评论

评论列表(0)

  1. 暂无评论