Skip to main content
iccolor
Inspiring
June 13, 2019
Answered

Animate CC HTML5 canvas in Internet Explorer ajax function not working

  • June 13, 2019
  • 2 replies
  • 2064 views

While my project works fine in Firefox and Chrome, but for some strange reason beyond my expertise my images and text being called by the .ajax function do not show up in IE.

Can anyone help?

$.ajax({

     type: 'GET',

     url: 'data/carousel.json',

     dataType: 'json',

     success: function (json) {

     carouselItems = json;

     consol.log(carouselItems);

     renderImages();

},

error: function() {

consol.log("error");

}

});

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

Use an XMLHttpRequest instead.

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest

Example:

this.loadJSON = function(url, callBack)

{

    var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()

    {

          if (this.readyState == 4 && this.status == 200)

              callBack(this.responseText);

    };

    xmlhttp.open("GET", url, true);

    xmlhttp.send();

};

this.loadJSON("data/carousel.json", function(response)

{

    alert(response);

});

Regards,

JC

2 replies

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
June 13, 2019

Hi.

Use an XMLHttpRequest instead.

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest

Example:

this.loadJSON = function(url, callBack)

{

    var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()

    {

          if (this.readyState == 4 && this.status == 200)

              callBack(this.responseText);

    };

    xmlhttp.open("GET", url, true);

    xmlhttp.send();

};

this.loadJSON("data/carousel.json", function(response)

{

    alert(response);

});

Regards,

JC

Known Participant
May 9, 2022

Hello JC,

I need some similar help here but with a post to a PHP script sending two variables.  Right now I had AJAX but it its not working either.  I put this in the last frame of my HTML5 app to run.

var viewed = 'yes';
var version = 'two';

$.ajax({
	url: '/dbscript.php',
        dataType: 'json',
	type: 'post',
	data: {viewed: viewed, version: version},
	success: function (responce){
	        //do something
	}
})

Any help here would greatly be appreciated!

JoãoCésar17023019
Community Expert
Community Expert
May 10, 2022

Hi.

 

I'm not a jQuery user but I saw here that IE is not supported since version 2.

 

And it may not be your case, but this PreloadJS page has some useful information regarding compatibility. I may give you some idea.

 

Sorry for not being able to help you better.

 

Regards,

JC

Joseph Labrecque
Community Expert
Community Expert
June 13, 2019

Looks like jQuery - and jQuery has a number of different ways of doing AJAX calls... some of which may not work in older browsers:

https://api.jquery.com/jQuery.ajax/

I'd also check to be sure the browser console is not outputting and warnings or errors.

iccolor
iccolorAuthor
Inspiring
June 13, 2019

Hi Joseph,

Thank you for responding.

Ill check out the link you provided.