Hi All,
am building an solution using JSON in sharepoint, but the issue is when i load one context in an solution, it doesn't complete and go to the next function and then come back and execute the function of the first context, like
$(document).ready(function()
{
function1();
function2();
}
)
function1()
{
var context1 = .........
.
context1.executeQueryAsync(success, failure );
function success(){}
function failure() {}
}
function2(){
var context2 = .........
.
context2.executeQueryAsync(success, failure );
function success(){}
function failure() {}
}
here what happens is , in function1 it will execute till excuteQueryAsync(), then it doesn't execute the success or failure function, it directly goes to function2 executes that and then return back to execute success and failure functions in function1,
why is this happening , some times it works properly and sometimes it doesn't
please let me know what am i doing wrong, thanks in advance