Side navigation
#14094 closed bug (notabug)
Opened July 02, 2013 02:45PM UTC
Closed December 16, 2013 04:55PM UTC
$.getScript Internet Explorer
Reported by: | markus.wagner@compuware.com | 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);
Attachments (0)
Change History (15)
Changed July 02, 2013 03:22PM UTC by comment:1
Changed July 04, 2013 05:04PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | new → closed |
I am unable to reproduce: http://jsbin.com/irakez/1/edit
Changed July 05, 2013 07:25AM UTC by comment:3
with your code, I get a syntax error in IE9 and 10
Changed July 05, 2013 07:45AM UTC by comment:4
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
Changed July 05, 2013 01:26PM UTC by comment:5
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.
Changed July 05, 2013 01:27PM UTC by comment:6
status: | reopened → open |
---|
Changed July 08, 2013 03:34PM UTC by comment:7
the same issue with $.getJSON
Changed September 09, 2013 09:54PM UTC by comment:8
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".
Changed September 10, 2013 06:41AM UTC by comment:9
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.
Changed September 12, 2013 10:37PM UTC by comment:10
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).
Changed September 13, 2013 06:16AM UTC by comment:11
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'' '''
Changed September 13, 2013 01:48PM UTC by comment:12
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.
Changed September 16, 2013 01:21AM UTC by comment:13
milestone: | 1.10.3/2.0.4 → 1.11/2.1 |
---|
Bulk update for new milestone
Changed December 11, 2013 02:10AM UTC by comment:14
I verified on IE 10 with jQuery version 2.1.0-pre, this issue has been fixed.
Changed December 16, 2013 04:55PM UTC by comment:15
resolution: | → notabug |
---|---|
status: | open → closed |
Javascript syntax errors can't be detected by the .error()
for this case, as documented.