dcsimg
Howto call JavaScript after AJAX loads?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hmmm_Hmmm
Posted On:   Monday, August 28, 2006 05:49 PM

Hey :) Situation: I use AJAX to reload a specific part of my page. The page loaded was parsed by PHP. I would like to run a JavaScript, after AJAX has finished loading, not before. Problem: The solution seems to be, to just implement the JavaScript consecutively, such as: onClick="someJavaScript(), loadAjax(), moreScript()" However, loadAjax() initiates the loading and goes on right away to moreScript(), without waiting for the page to finish loading. Solution: Well, that's why I'm here :) Thanks for any help... //myself    More>>

Hey :)



Situation:
I use AJAX to reload a specific part of my page. The page loaded was parsed by PHP. I would like to run a JavaScript, after AJAX has finished loading, not before.



Problem:
The solution seems to be, to just implement the JavaScript consecutively, such as:

onClick="someJavaScript(), loadAjax(), moreScript()"

However, loadAjax() initiates the loading and goes on right away to moreScript(), without waiting for the page to finish loading.



Solution:
Well, that's why I'm here :)



Thanks for any help... //myself    <<Less

Re: Howto call JavaScript after AJAX loads?

Posted By:   Anonymous  
Posted On:   Monday, August 28, 2006 08:07 PM

Well within loadAjax you should be making an AJAX call. Part of that call should be a callback that gets called when your data is available. After making sure the data is okay and full loaded and your javascript reloads the part of the page, call moreScript().
About | Sitemap | Contact