PDA

View Full Version : Ajax Problem with Javascript after loading a .PHP into a Div



lexle
01-12-2010, 10:17 AM
1) Script Title:

Dynamic Ajax Content


2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm


3) Describe problem:

Javascript isnīt recognized after loading a .php in a div via Ajax.

Here is my website:
http://www.alexmattersberger.com/portfolio/
Go to PHOTO and click on the picture above SPORTS on the left bottom.
As you can see in the status bar, I want to load a flash gallery (photo-snow.php) in the div "FEATURE".
Here is the .php i want to load in there. As you see it works when you go to it directly:
http://www.alexmattersberger.com/portfolio/photo-snow.php

But if I load it in the div, the JS
<script language="javascript" type="text/javascript" src="/portfolio/swfobject.js" ></script>
will be ignored.
I tried to load it onClick in the index.php
<a href="javascript:ajaxpage('photo.php', 'feature'); loadobjs('/portfolio/swfobject.js')">
but this also doesnīt work. there is always the problem that the JS swfobject.js isnīt recognized and so, the flashgallery can not be loaded.
Can someone please help me and tell me how i have to load this JS and where should i put it ?
thank you

ampera
01-12-2010, 10:21 PM
open this url.. http://www.dhtmlgoodies.com/index.html?whichScript=ajax_dynamicArticles (http://www.dhtmlgoodies.com/index.html?whichScript=ajax_dynamicArticles)

lexle
01-13-2010, 02:03 PM
Puh, thank you very much but Iīm sorry but i donīt understand this one.
Are you sure this will work?

lexle
01-15-2010, 01:46 PM
Iīve simply changed it and made it with an iframe.
Now it works. Thank you for your help.