Ajax Error Internet Explorer
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and ajax internet explorer 7 policies of this site About Us Learn more about Stack Overflow the ajax internet explorer 6 company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users ajax internet explorer 11 Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes
Ajax Internet Explorer 9
a minute: Sign up JQuery Ajax Error on Internet Explorer up vote -1 down vote favorite I'm making an Ajax Request, it's working in all browser, but in Internet Explorer It's not working. I need that works for internet explorer 9 + That's the request: function loadYoutubeVideos(youtubeUrl){ var url = 'youtubeUrl'; $.ajax({ type: 'GET', dataType: "json", url: url, success: function (responseData, textStatus, internet explorer ajax timeout jqXHR) { objYoutubeVideos = responseData; //more functions, blablabla }, error: function (responseData, textStatus, errorThrown) { console.log(textStatus, errorThrown); //error functions } }); } I'm making the some code for load a Facebook Page Content. What do I do? javascript jquery ajax internet-explorer share|improve this question edited Jul 8 '14 at 16:25 Benjamin 11.3k1692171 asked Jul 7 '14 at 16:01 user3813098 1 3 What's the error? What does not work? –Bergi Jul 7 '14 at 16:03 IE does not like cross-domain ajax requests... You should perform an ajax call to your server and send the api request from the server and pipe the results back to the client. stackoverflow.com/questions/3362474/… –StaticVoid Jul 7 '14 at 16:04 add a comment| 1 Answer 1 active oldest votes up vote -1 down vote Have you tried to using jsonp format? The json format has a issue when use over cross-domain (different domain). So, you need to use jsonp instead of json, jsonp using javascript callback for solve the cross-domain issue. more: http://www.sitepoint.com/jsonp-examples/ You don't need create pipe for api request. Youtube support jsonp format using
here for a quick overview of the site Help Center Detailed answers to any questions you might have internet explorer ajax settings Meta Discuss the workings and policies of this site About Us
Internet Explorer Ajax Cache
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with
Ie9 Ajax Error Access Is Denied
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just http://stackoverflow.com/questions/24614899/jquery-ajax-error-on-internet-explorer like you, helping each other. Join them; it only takes a minute: Sign up Jquery ajax error internet explorer up vote 2 down vote favorite I ma trying to use this ajax call: var url = ' http://api.official.fm/tracks/D4lw?fields=streaming,cover&api_version=2'; jQuery.ajax({ url: url, dataType: 'jsonp', }).done(function( data ) { //console.log(data); }).fail(function(jqXHR, textStatus, errorThrown) { if(useAlertMessaging) alert('error: ' + jqXHR.responseText); http://stackoverflow.com/questions/18238484/jquery-ajax-error-internet-explorer }); It works in IE10, but in IE9 and below I get this error: SCRIPT1004: Expected ';' D4lw, line 1 character 9 console shows: {"track":{"title":"Love Me As I Have Loved You (prod. Ritz Reynolds)","duration":75,"artist":"Mac Miller","url":"http://api.official.fm/tracks/D4lw?api_version=2","page":"http://official.fm/tracks/D4lw","buy_url":null,"rough_view_count":null,"rough_play_count":null,"rough_download_count":null,"streaming":{"http":"http://api.official.fm/tracks/D4lw/stream?api_version=2","rtmp":"rtmpe://fairtilize-174.fcod.llnwd.net/a2251/r2/mp3:/audio2/s/D4/D4lw_3594640?e=1378301197&h=8a551f822a7fbbc6fe07866626451bc3"},"cover":{"urls":{"large":"//cdn.official.fm/medias/pictures/tu/tuKi_large.jpg","medium":"//cdn.official.fm/medias/pictures/tu/tuKi_medium.jpg","small":"//cdn.official.fm/medias/pictures/tu/tuKi_small.jpg","tiny":"//cdn.official.fm/medias/pictures/tu/tuKi_tiny.jpg"},"id":"tuKi"},"project":{"name":"Mac Miller","url":"http://api.official.fm/projects/f8w6?api_version=2"}}} cursor is pointing right before the first track semicolor here: {"track" Is there anything I can do about this? (I dont control the url I use) I tried remove ajax dataType but the result is the same. ajax json share|improve this question asked Aug 14 '13 at 17:34 Toniq 64611730 Try removing the datatype: and replace with contentType: "application/json; charset=utf-8". –Chris O Aug 14 '13 at 17:36 I tried but the same error remains. –Toniq Aug 14 '13 at 17:40 Perhaps this post can help. –Chris O Aug 14 '13 at 17:54 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote I have had issues with adding an extra comma in objects in IE. Try this: jQuery.ajax({ url: url, dataTyp
Programming, Technology, Web Programming & Development with 25 comments I've written previously on how to handle AJAX requests for Internet Explorer but recently we came across a strange issue where the requests were being http://cypressnorth.com/programming/internet-explorer-aborting-ajax-requests-fixed/ aborted by IE before the response was finished being delivered. Using Fiddler and Firebug, we were able to see that the request was being made properly, and even the response was coming back properly, http://thisinterestsme.com/ajax-request-internet-explorer-cache/ but at some point, IE would simply stop accepting the data if it was not a very short response. The problem was even more perplexing because it did not happen every time and it internet explorer did not happen the same in all versions of IE, in fact IE 9 had more difficulty than IE 7. You might be familiar with the typical way of making an AJAX request using XDR for Internet Explorer. It would generally look like the following: //USING JQUERY if ($.browser.msie && window.XDomainRequest) { // Use Microsoft XDR var xdr = new XDomainRequest(); xdr.open("get", "someurl"); xdr.onload = function () { ajax internet explorer var JSON = $.parseJSON(xdr.responseText); if (JSON == null || typeof (JSON) == 'undefined') { JSON = $.parseJSON(data.firstChild.textContent); } processData(JSON); }; xdr.send(); } The process goes like this: Create the XDomainRequest object Define the request type (GET,POST) and the request path (URL) in .open() Define an event handler to capture the response in .onload() Send the request using .send() Depending on what you are returning, this is usually all you need.If you run into the problem that we were having, you need to do a little more to fix it. The Solution The problem has to do with IE timing out the request even though data is being transmitted. By defining some additional event handlers and specifying a timeout value of 0, IE will not abort the request prematurely. Your mileage may vary but for us the solution was to define the following handlers as empty: xdr.onprogress = function () { }; xdr.ontimeout = function () { }; xdr.onerror = function () { }; Then wrap the send() function in a timeout declaration: setTimeout(function () { xdr.send(); }, 0); Producing the final resulting XDR call of: if ($.browser.msie && window.XDomainRequest) { // Use Microsoft XDR var xdr = new XDomainRequest(); xdr.open("get", "someurl"); xdr.onload
all because of Internet Explorer and its ridiculous way of dealing with Ajax requests! Basically, I created a form that allowed users to add data to a dynamic list. Whenever the form was submitted, an Ajax GET request was made and the list in question was refreshed. Seems pretty straight forward, right?Nope!Unfortunately, a number of IE users got in contact with me to say that the form wasn't working for them. They said that the "form didn't work" and that "nothing was happening" when they pressed the submit button. At first, I thought that my JavaScript was throwing up errors in some of the earlier versions of Internet Explorer. However, after testing it out on IE7, IE8 and IE9, I saw that the console log was completely blank. No errors… no warnings… nothing.After that, I began to suspect CakePHP's method of session checking. You see, the results in the list were temporarily tied to the user's session ID and I had previously read about an issue where CakePHP would sometimes drop sessions belonging to Internet Explorer users.Apparently, in order to fix said issue, you need to place the following line into your Config/core.php file:PHP Configure::write('Session.checkAgent', false);1Configure::write('Session.checkAgent', false);For the purpose of clarity, this is what CakePHP's documentation said about the Session.checkAgent issue:PHP // Do you want the user agent to be checked when starting sessions? // You might want to set the value to false, when dealing with older versions // of IE, Chrome Frame or certain web-browsing devices and AJAX.123// Do you want the user agent to be checked when starting sessions?// You might want to set the value to false, when dealing with older versions// of IE, Chrome Frame or certain web-browsing devices and AJAX.To my dism