Skip to main content

Bug Tracker

Side navigation

#14397 closed bug (invalid)

Opened September 27, 2013 11:51PM UTC

Closed October 14, 2013 08:54AM UTC

jQuery v2.0.3 is executing a local script even when it is 404 Not Found .

Reported by: marcglasberg@gmail.com Owned by: marcglasberg@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.3
Keywords: Cc:
Blocked by: Blocking:
Description

In Chrome, I am loading a html page into a DIV using:

   $.get(address, "", callbackWhenDone).error(function () { alert(); });

This html page contains the following line:

   <script type="text/javascript" charset="UTF-8" src="http://localhost:8080/App/DOESNOTEXIST.js"></script>

The DOESNOTEXIST.js file does not exit in localhost, and JQuery knows it. However, JQuery executes it anyway. The console reads:

GET http: //localhost:8080/App/DOESNOTEXIST.js 404 (Not Found) jquery.js:6
XHR finished loading: "http: //localhost:8080/App/DOESNOTEXIST.js". jquery.js:6
Uncaught SyntaxError: Unexpected token < jquery.js:4

If the html instead contains

   <script type="text/javascript" charset="UTF-8" src="http://jquery.com/DOESNOTEXIST.js"></script>

then JQuery does not execute it. The console now reads only:

GET http://jquery.com/DOESNOTEXIST 404 (Not Found) jquery.js:6 

Maybe JQuery is executing it in the first case because it is at localhost, or because it is not a cross-domain js, but I guess if it finds a 404 it should not execute it under any circumstances, right?

Attachments (0)
Change History (2)

Changed September 29, 2013 09:07PM UTC by dmethvin comment:1

owner: → marcglasberg@gmail.com
status: newpending

Please create a test case using jsbin.com, see the instructions on that site for doing same-domain ajax requests.

Changed October 14, 2013 08:54AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!