Results 1 to 4 of 4

Thread: [FireFox & innerHTML] or [document.write that doesn't wipe rest of page data]

  1. #1

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Resolved [FireFox & innerHTML] or [document.write that doesn't wipe rest of page data]

    Alright, I have a frame and I want it to put text into the other frame. Now, there's two ways I can do it. I can use
    Code:
    parent.MyFrame.document.write ("data");
    which wipes the rest of the page away or I can use
    [CODE]parent.MyFrame.MyDIV.innerHTML =
    Code:
    parent.MyFrame.MyDIV.innerHTML + 'new text<BR>';
    The first is undesirable because the entire page is wiped clean to insert the new text. The second won't work in FireFox. My question: Is there anyway to keep a document.write() from deleting the rest of the page, or is their an equivilent to the innerHTML property in FF?
    Last edited by Disiance; Jul 2nd, 2005 at 10:38 AM.
    "I don't want to live alone until I'm married" - M.M.R.P

  2. #2
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: [FireFox & innerHTML] or [document.write that doesn't wipe rest of page data]

    try this:
    HTML Code:
    document.getElementById("frame").contentWindow.document.MyDIV.innerHTML="hello";
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [FireFox & innerHTML] or [document.write that doesn't wipe rest of page data]

    The innerHTML property exists. outerHTML is missing. And of course you can use plain new DOM manipulation.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: [FireFox & innerHTML] or [document.write that doesn't wipe rest of page data]

    Quote Originally Posted by ALL
    try this:
    HTML Code:
    document.getElementById("frame").contentWindow.document.MyDIV.innerHTML="hello";
    Thank you so much ALL, works perfectly.
    "I don't want to live alone until I'm married" - M.M.R.P

Posting Permissions

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



Click Here to Expand Forum to Full Width