PDA

View Full Version : "onload" when loading external content dynamicly with AJAX



netridah
12-13-2006, 06:26 PM
1) Script Title:
Dynamic Ajax Content

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm


3) Describe problem:
I have a navigation bar set up that uses AJAX to dynamically load content into the "contentDIV" on my page. The content being loaded ("info.html") contains two more divs that I want to dynamically load content into using AJAX.

Everything works fine if I place an HREF on the "info.html" page, when those are clicked it loads the two other html pages into it's DIVs.

However, what I am trying to do is have these 2 DIVs contained in "info.html" load the dynamic content as soon this info.html is loaded into my contentDIV on the main page. It seems to me that when Ajax loads this page it does not run any <script> placed within the info.html page.

Is there a way to invoke an onload function to execute the script that will load the content into the 2 "sub" DIVs on info.html?

I have just tried placing the "ajax" function into a <body onload=""> in info.html, but this doesn't work either.
(<body onLoad="ajaxpage('project123/1.html', 'pCreative');">) This does work if I pull up info.html directly in the browser, but not if info.html is being loaded using AJAX to the contentDIV on my main page.

TIA,
alex

jscheuer1
12-14-2006, 06:34 AM
http://www.dynamicdrive.com/forums/showthread.php?p=52616#post52616