Opened 10 years ago
Closed 9 years ago
#14094 closed bug (notabug)
$.getScript Internet Explorer
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | 1.11/2.1 |
Component: | ajax | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If i call $.getScript on a script that doesn't exist (webserver returns html error page instead of script).
-> Internet Explorer in combination with jQuery 1.10.1 throw
SCRIPT1002: Syntax error
$.getScript('failscript', data, successCallback) .fail(errorCallback) .done(callback);
Change History (15)
comment:2 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I am unable to reproduce: http://jsbin.com/irakez/1/edit
comment:4 Changed 10 years ago by
i'm getting the same error with your created script: SCRIPT1002: Syntax error runner, line 1 character 1 SCRIPT5007: Unable to get property 'proxyconsole' of undefined or null reference runner, line 7 character 3
http://i.imgur.com/bjo80Ei.png
i'm using IE10
comment:5 Changed 10 years ago by
Component: | unfiled → ajax |
---|---|
Milestone: | None → 1.10.3/2.0.4 |
Priority: | undecided → high |
Resolution: | worksforme |
Status: | closed → reopened |
Ah, I was looking at the firebug lite console and the error went to the F12 console. There is an error there.
comment:6 Changed 10 years ago by
Status: | reopened → open |
---|
comment:8 Changed 9 years ago by
I guess you are getting this console message only in jsbin.com
Try using jsfiddle.net to reproduce this issue. Maybe we are actually debugging jsbin.com instead of jquery core. runner.js seems not to be a jquery part.
In jsfiddle the console output is something like "access denied".
comment:9 Changed 9 years ago by
no we are getting this message also in a local testenvironment. if you build a simple html page and start it with the internet explorer 9/10.
comment:10 Changed 9 years ago by
sorry i was not even able to reproduce this error locally. I only get the console output "fail". What is expected.
can you provide us with some more information about your system (exact browser version, operating system).
comment:11 Changed 9 years ago by
I think your problem is you send the request just in a simple html page without a webserver. So your response in the Internet Explorer is nothing and you don't get an error. But try this page:
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>JS Bin</title> </head> <body> <div id="elem"></div> <script src="http://code.jquery.com/jquery-git.js"></script> <script> $.getScript('test.html', function() { console.log('success'); }).done(function(){ console.log('done'); }).fail(function(){ console.log('fail'); }); </script> </body> </html>
name your page test.html and send the request to test.html (it's important you get some data!) then you get a syntax error in IE9/10
comment:12 Changed 9 years ago by
Ok. Now I was able to reproduce your issue. But in fact it is not a bug:
jQuery has a problem with your loaded content.
$.getScript functions expects a Javascript file to be loaded not html!
this is also specified in the jquery api documentation.
http://api.jquery.com/jQuery.getScript/
So I would not consider this as a bug and suggest to close this ticket.
comment:14 Changed 9 years ago by
I verified on IE 10 with jQuery version 2.1.0-pre, this issue has been fixed.
comment:15 Changed 9 years ago by
Resolution: | → notabug |
---|---|
Status: | open → closed |
Javascript syntax errors can't be detected by the .error()
for this case, as documented.