1) Script Title: DHTML Widget window
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
a) I tried unsuccesfully to have the window open on page load
b) Can files with dynamic content be loaded in the window?
example
1) Script Title: DHTML Widget window
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
a) I tried unsuccesfully to have the window open on page load
b) Can files with dynamic content be loaded in the window?
example
Last edited by ddadmin; 04-29-2007 at 08:53 AM.
If you're using the iframe option to load a DHTML window, that page can essentially contain anything, including dynamic content. As long as it renders correctly on its own, it shouldn't be any different when that page is loaded .via iframe inside the DHTML window instead.
Unfortunately I am using AJAX.
How is dynamic content handled in AJAX?
All pages are on the same site, in the same directory
The main issues relating to a page fetched via Ajax have to do with JavaScrips and CSS codes correctly being transferred over:
1) In IE, they generally will not be transferred over. This means you need to include these JavaScript/CSS code on the main page that's including the fetched page instead.
2) An even more fundamental issue affects all browsers (ie: Firefox), and stems simply from the way Ajax pages are included- dynamically, using the .innerHTML property for example. This means if your external page contains a JavaScript that dynamically outputs something on runtime in that page, for example:
That output will not shown up when it's included on the main page via Ajax, as this is a runtime operation, which Ajax isn't (it's asynchronous or dynamic).Code:document.write("My name is John")
If your external page contains JavaScripts or CSS, in general, the iframe option is the easiest way to get things working correctly for the DHTML window widget.
I found some interesting discussion on this here and there.
I have been trying to use the idea from a solution/workaround suggested here.
I tried placing variations of
...in the dhtmlwindow.js file in either init or open function sections, and I thought I was observing something, but....Code:var styles=t.getElementsByTagName("style") for (var i=0; i<styles.length; i++){ eval(styles[i].text) } var scripts=t.getElementsByTagName("script") for (var i=0; i<scripts.length; i++){ eval(scripts[i].text) } var divs=t.getElementsByTagName("div") for (var i=0; i<divs.length; i++){ eval(divs[i].text) }
...Well... maybe one of you geniuses will see this and go "AHA!" and know what to do with something like this?!? It seems logical that once the content is loaded you could re-eval the text in there, and cause the imported html page to actually render -- no?!
Cheers,
TwoHawks
SEE ALSO:
Dynamic innerHTML content (ajax)
Eval’ing with IE’s window.execScript
Hmm.... maybe this is the deal here...
nerd ~Going Global
I hope some of you experts here check this out and, if there is a solution lurking here, will help point it out and help us noobs to better understand how to be applying it here ;^)
Cheers,
TwoHawks
Last edited by twohawks; 10-07-2007 at 08:07 AM.
Bookmarks