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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.