Log in

View Full Version : Help on Dynamic Ajax Content



Raji
02-03-2009, 06:07 PM
1) Script Title: Dynamic Ajax Content

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

3) Describe problem: This is a great script and I am using it to load a few external pages. However the CSS and JS on that external page doesn't seem to load on the "right column" which is the designated content area. I used the additional couple of codes at the bottom to load them as you have instructed but it still comes up without it...

I have been trying to use Dreamweaver CS4 and it's 3rd party widgets like jquery, phatfusion ect and ran into similar issues as they didn't seem to work toghether. So I am wondering if such an issue effecting this problem as well, because...

First, on the left column instead of the regular links as in the demo, I am using a vertical CMotion Image Gallery from Dynamic Scripts. This works correctly when I link the image buttons to the external.html files given with the Demo.

Next, the external page has a jquery lightbox plugin gallery which uses jquery scripts along with it's css. This works without a glitch on it's own.

Finally, I have to say I am a front end designer and not a developer... so please bare with me for this trouble... Any help is much appreciated.

jscheuer1
02-04-2009, 05:23 AM
The loadobjs() function of this script is actually a bit of a red herring. Using it is no different than if you have the style and/or scripts it is meant to import already on the 'top' page, that is if it works, which it doesn't always because sometimes there isn't enough time to import.

So, whatever style you want for your imported content, just put on or link it to the 'top' page in the usual manner as is done for a non-AJAX page.

hpub
02-09-2009, 08:55 PM
Whatever I try I cannot load javascript into a <Div> via the Dynamic Ajax Content script using loadobjs :confused:
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

I am using Jquery as well on the inital page, but I have removed it and it still will not load the external javascript in a div.

This is my URL link in the page.

<a href="javascript:ajaxpage('Events/October.htm', 'EventContent'); loadobjs('css/tabcontent.css', 'js/tabcontent.js')">October</a>

The link succesfully loads the external page October.htm AND the CSS! into the correct DIV on my page. but not the javascript it uses. It is not a spelling error or path error.

I have tried loading the tabcontent.js in the head of the main page.
<script type="text/javascript" src="js/tabcontent.js"></script> But still no luck.

What am I missing????
Please help.. I really don't want to have to use an IFRAME! :eek:

dnfhosting
02-25-2009, 02:40 PM
I absolutely love this script but I'm having the same issue with js. ANYTHING using JS from the linked page doesn't work in the div. I have tried loading the js via the main page as well but that didn't fix it. The page I'm (currently) trying to load has the js in the page itself, not imported, so it's not a link issue. If the file is loaded outside the ajax content page it works fine. :confused:

thanks for any advice!

jscheuer1
02-25-2009, 03:41 PM
You cannot load javascript via AJAX. If the scripts you want to run against AJAX imported content are already on the 'top' page it may work. If not, they must be reinitialized (sometimes, to avoid breaking a particular script, this must be just a partial reinitialization) after the imported content arrives, or some other method of getting the imported markup recognized by the script must be used.

This question was originally about style. That's easy, just put it on the 'top' page.

Now, each script someone might want to use in an environment where AJAX is involved will usually have different potential workarounds, at least in their details.

So, please - if you are not the person who started this thread, start a new thread about your specific issue(s).