Jump to content

onLoad script execution / even triggers?


Maximus

Recommended Posts

I am currently doing a lot of work with AJAX based web applications, and I find it to be a real drag that you cannot use the "onLoad" event to call functions when loading sections of a page with AJAX.

 

My problem is that I have to execute a piece of code as soon as the page is loaded (dynamically, using ajax).  On normal sites, this would work with the onLoad property, so once the page has loaded, that event would trigger a JS function of my choice.  But with AJAX, only a part of the site "refreshes/loads" so this event handler is useless.

 

I have tried simply putting the function I want to execute upon loading in script tags like so:

<script type="text/javascript">
loadContent('pagename', 'divname');
</script>

but with no success :-(

 

Does anyone know how to solve this problem?  This is really important to me, and I would really appreciate any help, thanks.

Link to comment
https://forums.phpfreaks.com/topic/38588-onload-script-execution-even-triggers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.