To answer your first question, the the body's ONLOAD command is executed  
once the page has completed loading.  Having script in your HTML gets  
executed at different times depending on the browser (at least that's my  
experience).

As for the other questions, why do you need 2-3 ajax calls to execute on  
page load?  You should be able to do everything you need in once  
request.  For example, check out the code for PalmSphere.com; it uses an  
XHR to load JavaScript code from the server, and then eval's it - this  
is used to populate some JS array's, etc.  Then, I use use JS to  
interpret the data and act accordingly (i.e. mark favorites, update  
favorite counter, etc.).  In fact in DevLists I abandoned this method  
entirely and simply populated the JS arrays during the intial page  
render; it caused the back button to break sometimes, but the improved  
performance was worth it.

HTH.

On Tuesday, March 07, 2006, at 7:37 PM, Jan Deppisch wrote:
>Hi,
>
>currently I execute 2-3 AJAX-Calls (located at the end of html-body) on
>loading the page. I run into problems now because they are executed
>parallel of course :)
>
>How can I garuantee that the Calls are executed when the page has loaded
>completely ?
>
>And, more interesing, how can I make one AJAX-Call start when the
>previous has completely finished ?
>
>I've read about Effect.Queues - is that the keyword ??
>
>Thanks for your help
>Jan
>
>_______________________________________________
>Rails-spinoffs mailing list
>Rails-spinoffs@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


Cheers!
--Dave Teare
http://devlists.com - Email list management
http://palmsphere.com - Apps for your hand-held


-- 
Posted with http://DevLists.com.  Sign up and save your time!
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to