Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14397 closed bug (invalid)

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

Reported by: [email protected] Owned by: [email protected]
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?

Change History (2)

comment:1 Changed 9 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

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

comment:2 Changed 9 years ago by trac-o-bot

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!

Note: See TracTickets for help on using tickets.