Highlighted

Animate CC HTML5 canvas in Internet Explorer ajax function not working

Explorer ,
Jun 13, 2019

Copy link to clipboard

Copied

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");

}

});

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

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

TOPICS
Discussions

Views

556

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Animate CC HTML5 canvas in Internet Explorer ajax function not working

Explorer ,
Jun 13, 2019

Copy link to clipboard

Copied

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");

}

});

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

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

TOPICS
Discussions

Views

557

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 13, 2019 0
Adobe Community Professional ,
Jun 13, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2019 0
Explorer ,
Jun 13, 2019

Copy link to clipboard

Copied

Hi Joseph,

Thank you for responding.

Ill check out the link you provided.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2019 0
Explorer ,
Jun 13, 2019

Copy link to clipboard

Copied

I corrected all errors but 1 and the data is still not populating.

Error: TypeError: Cannot read property (the textContent is what the error is referring to).

Note:  I am working your Data-Driven Animation video - rss feed.

root.feedTitle.text = title[0].textContent;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2019 0
Adobe Community Professional ,
Jun 13, 2019

Copy link to clipboard

Copied

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2019 0