Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Link between DHTML windows and DIVs or IFRAMEs

  1. #1
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Link between DHTML windows and DIVs or IFRAMEs

    1) Script Title: DHTML window widget (v 1.03)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/index.htm

    3) Describe problem:

    Is it any way to target and div or an Iframe on the base page from within one of the windows. I tried:

    Code:
    <a href='javascript:parent.IframeOnBasePage.load("iframe", "MyPage.php", "New Page Title")'>Load a Page</a>
    However, that did not work.

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

    Default

    I'm confused, are you trying to populate a regular iframe on the page with something from a link within one of the DHTML windows, or a IFRAME DHTML window? The two are very different...

  3. #3
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry for the confusion. I try to populate a regular Iframe from within a DHTML window...

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

    Default

    If it's just a regular iframe, first, give it an name attribute:
    Code:
    <iframe name="myframe" src="http://google.com"></iframe>
    Then, inside your DHTML window, your link to load content into it would look something like:

    Code:
    <a href='javascript:parent.frames["myframe"].location.replace("http://yahoo.com")'>Load Yahoo</a>

  5. #5
    Join Date
    Aug 2007
    Location
    Louvain-la-Neuve (Belgium)
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default div way

    Hi,

    Is there a way to get the same result with the div ?

    I mean, the content of my window are in a div like in an example (I prefer that way) but I want to put that div into another page, so I can open window with the same content from different web pages. But I don't want to deal with iframe


    thanks in advance

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

    Default

    Ok you're going to have to explain that again.

  7. #7
    Join Date
    Aug 2007
    Location
    Louvain-la-Neuve (Belgium)
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default div

    first of all, thank you for your answer.

    So, I have the content of my window in a DIV like the window4 example
    and everything works great !

    Now, I want to put that DIV in an external html file, in order to have window with the same content in different page, without copy/paste the DIV code in every page.

    I'm looking for a way to tell the "dhtmlwindow.open(...)" the path of the file where it can find the DIV

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

    Default

    Ok, if I understand you correctly, you wish to duplicate the contents of the DIV on multiple pages easily, so multiple windows display this content. Why not just use the iframe or event Ajax option of DHTML Window widget then?

    The only way to easily embed a DIV on multiple pages by editing just one file is through something like SSI (server side includes): http://javascriptkit.com/howto/ssi2.shtml If your page is PHP or ASP for example, there are equivalents for it as well.

  9. #9
    Join Date
    Aug 2007
    Location
    Louvain-la-Neuve (Belgium)
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    before discoreving Dynamic Drive, I used dhtmlgoodies. In that library, it was possible to put div in a separate html file and call the file while creating the window. I abandon dhtmlgoodies because it was buggy and dynamic drive is much more easier to use and faster.

    I wanted to re-use my previous code as much as possible. Moreover, I don't really like iframe, but I think that I have to change my way of working in order to get the result I expect.

    I can't use the server side (php or jsp) because I'm in pre-dev state.

    Thank you for your answer.

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

    Default

    Hmmm if you can't use the iframe or ajax option, what this basically comes down to is finding a way to embed an inline content on multiple pages from a single external source. There is really no other way than to use server side to accomplish this, whether it's SSI, the include() feature of PHP, or so on...

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
  •