Skip to main content
iccolor
Inspiring
Jun 13, 2019 10:09 AM UTC
Answered

Animate CC HTML5 canvas in Internet Explorer ajax function not working

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 is closed to new replies. Start a new post to keep the conversation going.
JoãoCésar17023019
JoãoCésar17023019Correct answer
Community Expert
Jun 13, 2019 4:52 PM UTC

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

11 replies

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
Jun 13, 2019 4:52 PM UTC

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

Translate
Known Participant
May 9, 2022 7:20 PM UTC

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!

Translate
JoãoCésar17023019
Community Expert
Community Expert
May 10, 2022 1:01 PM UTC

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

Translate
Joseph Labrecque
Community Expert
Community Expert
Jun 13, 2019 12:10 PM UTC

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.

Translate
iccolor
iccolorAuthor
Inspiring
Jun 13, 2019 1:03 PM UTC

Hi Joseph,

Thank you for responding.

Ill check out the link you provided.

Translate