SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist Umair.ms's Avatar
    Join Date
    Sep 2000
    Location
    Lahore, Pakistan
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamically loading content into an IFRAME

    How do I dynamically load content into an IFRAME without using a src tag. I want this content to be display as the page loads (using JavaScript).
    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion.
    Interact and Share your Views with People around the Globe.

  2. #2
    SitePoint Evangelist Umair.ms's Avatar
    Join Date
    Sep 2000
    Location
    Lahore, Pakistan
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    P.S. I know that I have to assignment some value to innerHTML property BUT at which event?
    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion.
    Interact and Share your Views with People around the Globe.

  3. #3
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well onload of the iframe is a good idea.

    Set a reference to the iframe and then access it's innerHTML once it's loaded like this:

    var dF = document.frames('iframe_id').document;

    then onload of the iframe:

    dI = dF.innerHTML;

    Then you can use dI to access the iframe, ( hopefully ).

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #4
    SitePoint Evangelist Umair.ms's Avatar
    Join Date
    Sep 2000
    Location
    Lahore, Pakistan
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if(defaultContent != "")
    myFrame.document.body.innerHTML = defaultContent;

    The above statement was working fine two/three days back. But not now.

    Flawless_koder, your solution doesnot seem to do anything. No error! No success!
    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion.
    Interact and Share your Views with People around the Globe.

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) it might have stopped working because it can't initiate
    the object anymore

    2) i can't see any code of yours - so i can't tell you why
    it's not working ... soooo.....


    url?


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •