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

09-10-2009, 09: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

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

<script type="text/javascript">
window.onload = function()

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

<body onload="ajaxfunctionhere()">

09-10-2009, 04: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