PDA

View Full Version : Adding javascript inside Ajaxcontent script



onigetoc
03-24-2007, 02:45 PM
1) Script Title: ajax content

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

3) Describe problem:

I can't mix javascript inside the ajaxcontent scritp.

I'm trying to add the java tab inside the ajaxcontent script but it doesn't work. even a simple mouse over doesn't work inside the ajaxcontent,

Any idea how to mix or add javascript with ajaxcontent?

cheer

jscheuer1
03-24-2007, 04:08 PM
A simple mouseover should work as long as any paths used in its code are correct for the 'top' page's location. However, if your mouseover code requires initialization and/or preloading onload, it isn't entirely simple. If images must be preloaded, that can be done on the top page, once again, the paths must be valid for that page. If other initialization is required, it must be done after the content is imported to the top page. Paths must be correct for the top page as that is where the code actually is. Initialization strategies are discussed here (simpler and good for most things):

http://www.dynamicdrive.com/forums/showthread.php?t=17426

and here (more complex but good for tough cases):

http://www.dynamicdrive.com/forums/showthread.php?t=13003

onigetoc
03-25-2007, 06:37 AM
Thank you,
loading all .js in the top page helped.
some scripts who need something to close the script doesn't work. i will looking for javascript who don't need code at the end of script.

Now i'm looking to add a search form in the ajax content script.
I created a link to test if my search results work and it's working
here the code:

<a href="javascript:ajaxpage('index.php?do=recherche&seek=music', 'maincolumn');">link to click</a>

The world "music" is the query test.

Any Help to create a search form?

Thank you