...

View Full Version : performing ajax funtion on page(body) upload event



tehni
09-10-2009, 08:11 AM
hi guys
i hope u all r doing well... i have a problem ,, i wanna ask that is it possible to perform an ajax function when page is uploded... i.e ajax function perform automatically when a page is load... (on body's upload even)???? if so plz tell me how to do it
regards

Zangeel
09-10-2009, 08:28 AM
Although this is not a php question, you should be able to use something like



<script type="text/javascript">
window.onload = function()
{
ajaxFunctionHere();
}
</script>

funnymoney
09-10-2009, 03:09 PM
if that doesn't work you can try this



<body onload="ajaxfunctionhere()">

angst
09-10-2009, 03:13 PM
I find with ajax it's better to put the tag at the bottom of the page if you need something to trigger on load, this way you can be sure that all the other page elements are indeed loaded.

just drop it at the end if your script like


<script>ajaxfunctionhere();</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum