Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Very Slow Loading of External Text from JSON Feed.

Explorer ,
Nov 16, 2018 Nov 16, 2018

Can Anyone help me speed this up. Starting to think it is the Nature of Jquery and not Animate.

var tl = this

$.get("https://give.benevolentenabler.com/api/custom/totals/1", function (data) {

var txt = tl.theTime;

var fill = canvas.getContext("2d").createLinearGradient(7, 0, 0, txt.getBounds().height);

fill.addColorStop(0, "#FFFFFF");

//fill.addColorStop(0.5, "#0F0");

fill.addColorStop(1, "#ffd800");

txt.color = fill;

   

        txt.text = "$" + data.raised;

    if (!data.raised.length) {

        tl.gotoAndPlay('Slide2');

    }

})

.fail(function (e) {

alert("BROKEN");

    tl.gotoAndStop('Slide2');

});

tl.stop();

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

correct answers 1 Correct answer

Community Expert , Nov 16, 2018 Nov 16, 2018

there's going to be an unavoidable delay.  for me that's less than 1 second but it depends on a user's connection.

if any delay is unacceptalbe, display something acceptable while waiting for the json to load.

Translate
Community Expert ,
Nov 16, 2018 Nov 16, 2018

i don't see any significant delay.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 16, 2018 Nov 16, 2018

People I am working with do not like that it shows frame one's background then loads the dynamic content about a second later. This will be used in an ad rotation where each ad only gets 8 seconds before the next ad shows. They do not want to waste a second.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2018 Nov 16, 2018

The code just to load some JSON is trivial. If you're seeing a significant delay, it's because your server and/or network connection is slow.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2018 Nov 16, 2018
LATEST

there's going to be an unavoidable delay.  for me that's less than 1 second but it depends on a user's connection.

if any delay is unacceptalbe, display something acceptable while waiting for the json to load.

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