Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Multiple Asynchronous querys not working

$
0
0

Hello!

I am currently developing a Sharepoint 2013 App for Project Server, and it has multiple functions that have ExecuteQueryAsync in them

When the page loads, it calls the first function, which has an executequeryasync. This method will go thru without errors.

After this, if I call somehow the second function, this will fail with an error message.

My question is : how can I time these methods, so every Async query would go down one after another without any problems?

Example : 

$(document).ready(function () {
     function_A();
     if(button is clicked) {
         function_B();
         function_C();
     }
}

function function_A() {
     does something...
     ExecuteQueryAsync() {
     ....
     }
}

function function_B() {
     does something different...
     ExecuteQueryAsync() {
     ....
     }
}

function function_C() {
     does something different...
     ExecuteQueryAsync() {
     ....
     }
}

So function_A does something when the page loads.  It goes thru without any errors.

After that, I try to call function_B with a button click, and I get 

Unexpected response from server. The status code of response is '404'. The status text of response is 'Not found'.


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>