Results 1 to 6 of 6

Thread: Populating DHTML Widget window

  1. #1
    Join Date
    Oct 2005
    Posts
    63
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Populating DHTML Widget window

    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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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.

  3. #3
    Join Date
    Oct 2005
    Posts
    63
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    Unfortunately I am using AJAX.

    How is dynamic content handled in AJAX?
    All pages are on the same site, in the same directory

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    document.write("My name is John")
    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).

    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.

  5. #5
    Join Date
    Oct 2007
    Location
    Statline, Nevada usa
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    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
    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)
    	}
    ...in the dhtmlwindow.js file in either init or open function sections, and I thought I was observing something, but....

    ...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

  6. #6
    Join Date
    Oct 2007
    Location
    Statline, Nevada usa
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •