Skip to main content
Inspiring
November 16, 2018
Answered

Very Slow Loading of External Text from JSON Feed.

  • November 16, 2018
  • 1 reply
  • 333 views

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

    This topic has been closed for replies.
    Correct answer kglad

    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.

    1 reply

    kglad
    Community Expert
    Community Expert
    November 16, 2018

    i don't see any significant delay.

    Inspiring
    November 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.

    Legend
    November 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.