Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    loading content into an object.

    In order to load the output of an ASP/VBscript into an html page I'm using javascript.

    I was wondering if and how I could load the content into a paragraph, specified <p id="para1"> ,
    of a hidden iframe <iframe id="ifrm">

    I tried this para1.innerHTML=document.ifrm.document.body.innerHTML;
    and this
    para1.innerHTML=window.frames['ifrm'].document.getElementById('theBody').innerHTML;

    I'm sort of a novice in javascript. Please tell me how I can solve this problem in ie and netscape.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, this works for me in IE5.5 and Moz 1.0:

    Code:
    document.getElementById("para1").innerHTML = window.frames["ifrm"].document.body.innerHTML;
    This will *not* work in Netsape4.x or lower. Just because of the simple reason that older Netsape versions do not support the <iframe> tag. You'll have to resort to <layers> and the document.load method if you have to support these dead horses.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried this para1.innerHTML=document.ifrm.document.body.innerHTML;
    and this
    para1.innerHTML=window.frames['ifrm'].document.getElementById('theBody').innerHTML;
    Your second attempt was close, this should work:

    para1.innerHTML=window.frames['ifrm'].document.body.innerHTML;

    Use Modred's solution, it's more portable.
    Last edited by Roy Sinclair; 08-21-2002 at 04:23 PM.


  •  

    Posting Permissions

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