PDA

View Full Version : Dynamic Ajax Content SERIOUS problem



upside
05-15-2007, 09:30 PM
1) Script Title: Dynamic Ajax Content

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

3) Describe problem:

DESPERATELY tried to find an alternative to using IFRAMES (Since it seems so many developers HATE them) and would love to think that your Dynamic AJAX Script is the answer, However.....

I have tried SEVERAL methods to Embed a Flash file (SWF) within pages that are loaded via the "Dynamic AJAX Content" method... for each method the flash simply does not load... it acts as if there was nothing there at all. I have tried swfobject among a few others... Could it be that this is actually a JAVASCRIPT issue since all the methods i attempted to use to embed the flash (SWF) were written in javascript?

I have also noticed that no one seems to want to address this issue? i have seen this question posted other times to no avail... i realize that there are developers/programmers that HATE flash, but can we at least get some response? (I agree that flash is abused on the web all over the place, however in my particular case my client is requesting that dynamic content show up in a strange font, best solution i could find was to use flash)

Another STRANGE thing i noticed, the Dynamic AJAX content scripts work fine otherwise but i noticed that when viewing the Page Source, any content loaded via AJAX does not show up? it loads but does not show up when viewing the page source in the browser.

mburt
05-15-2007, 10:07 PM
that when viewing the Page Source, any content loaded via AJAX does not show up?
Remember, you're dealing with JavaScript - a client site language - and executes scripts after the page is loaded. If you used an include with a server-side language, you would see the code, because it's loaded before the pages loads.

This may be an AJAX issue, but iframes won't kill you if you use them once.

upside
05-15-2007, 10:28 PM
OK OK OK........ I realize where i went wrong (please note: i come from a print design background, all coding i do is self taught, however i am doing my very best to use standards and keep things accessible etc.... im trying people... im trying....)

So i have the answer to the FLASH issue and in fact it was already answered on the script page... its not a FLASH issue at all... the answer refers to:

Load page and external CSS /JavaScript link:
If you wish to style your external pages using CSS or JavaScript, you should NOT insert them directly inside the external page. Rather, save them as external files (.css and .js), and let the script apply them dynamically when the external page is loaded using function "loadobjs()".

NOW HANG ON A SEC... BEFORE ANYONE SCREAMS AT ME... I DID READ THIS ORIGINALLY.......HOWEVER........my problem involved specifically trying to embed an SWF file using the popular swfobject.js model.... Now i had the swfobject.js ALREADY seperate and in the head of the document which was using the Dynamic AJAX Script (DAS) to load other content into divs on the page.... (in other words no need to use LOADOBJS to apply this .js code to content) That content being sections that had swf files embeded using swfobject.js, however (LIKE AN IDIOT... i know i know...) i didnt stop to think that ANY AND ALL javascript must be loaded seperately via LOADOBJS for any section loaded via DAS.... so what i needed to do was to strip the javascript that embedded the flash, save it as a seperate file (embedSWF_headline.js) and then use LOADOBJS to apply it to the section loaded via DAS.... sorry i cant take the time to post actual code here, ive already wasted too much time on this, but i thought id be nice and try to help out the other nubies..... hope that makes sense guys!

Hope that makes sense, its a crazy world out here trying to survive as a designer on the web.... and in case your wondering why i dont just hire a programmer to work with.... welp.... two reasons... most clients tend to say their budget sucks haha... and secondly, even though i consider myself a designer and not a coder..... i do like my code to be clean, use variable names that make sense etc.... so i decided to go it alone... :)

upside
05-15-2007, 10:36 PM
With regard to the html not showing up when viewing PAGE SOURCE.....
"Remember, you're dealing with JavaScript - a client site language - and executes scripts after the page is loaded. If you used an include with a server-side language, you would see the code, because it's loaded before the pages loads."

I now have DYNAMIC AJAX SCRIPT WORKING PERFECTLY For all content....(yippie! ...NO MORE IFRAMES) but my question is..... if the dynamically loaded content isnt showing up in the page souce will search engines still have the same problems they have with iframes and content???

Was all this for nothing?!

cb010101
08-20-2007, 01:39 AM
I follow the logic here, but can't seem to execute this when trying to call this external javascript from my Flash button.

My actionscript looks like this. Where am I missing the boat?

on (release)
{
getURL("javascript:ajaxpage('page.html', 'content-area'); loadObjs('swfobject.js')");
}

I have a Flash nav. Clicking a menu item opens (in this case) page.html in the content-area div. Works fine when I don't use swfobject, but since I need that for IE, I'm trying to call it from the Flash button.