0

On document.ready() Implemented two Ajax calls.. and onLoad of an svg element,i need to access the response of one of the ajax calls to modify the svg content.(Im sure document.ready gets executed first and the svg load takes place with some delay since it had to wait till the object gets downloaded)

Doubt Scenario1

   Will 2nd ajax call wait until first ajax call callback is called?

   will svg object loading waits until 2nd Ajax call callback is called??

If the above flow is not correct??

Then I may or may not get the response of Ajax call to manipulate the svg object when its onload event handler is called.

I can achieve the above functionality by placing the Ajax calls in the same event handler of svg onload... But I want the actual underlying flow of the above

Can anyone explain the basic flow of this??

  • Try with this http://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-request-are-done and http://api.jquery.com/jQuery.when/ – Naga Harish M Jan 09 '14 at 09:37
  • 1
    Could you be more specific? Usually ajax calls are asynchronous hence you will require callbacks that will accept a response parameter from the server and if I got your question right your best option is to nest those ajax calls on the success event of each one. You could also try the jQuery.when method as @NagaHarishMovva says. – Charlie Affumigato Jan 09 '14 at 09:39

0 Answers0