Ajax response is taking time to populate.

Posted by Rachel on Stack Overflow See other posts from Stack Overflow or by Rachel
Published on 2010-12-28T14:13:19Z Indexed on 2010/12/28 14:53 UTC
Read the original article Hit count: 218

Filed under:
|
|

I am having an util class which is not owned by me. I am calling one of the method of that util class which inturn calls one ajax function. And gives me response back.

I need to make a decision depending on the response object. The problem is that response object takes some time to populate(mili seconds).

var selector = dojo.byId("SelectorId");
var theChart = new chart( selector, 135, 92, style, frequency, time);

if(theChart.data ===null){
    console.log("No response");
}else{
    Console.log("Use response data");
}

and

chart( selector, 135, 92, style, frequency, time);

is not owned by me. chart() is from util class.

above snippet works fine with break point. But when I remove the breakpoint it starts going in "if" block always.

Hows can I solve this issue.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about AJAX