Results 1 to 6 of 6

Thread: InnerHTML, how do I do this with Netscape??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343

    InnerHTML, how do I do this with Netscape??

    I want to replace the innerHTML of a DIV tag. This works great in IE but I need it to work in netscape too....

    The DIV has an ID...

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  2. #2
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237
    Code:
    <html>
      <head>
        <script language="JavaScript"><!--
    	if(navigator.appName=='Netscape')
    	{
    	alert('Use a proper browser you fool!')
    	}
    //--></script>
      </head>
      <body>
    
      </body>
    </html>
    Another light-hearted post from Guru

  3. #3
    Lively Member
    Join Date
    Feb 2002
    Posts
    69
    document.getelementbyid('div_id').innerhtml="blah";

  4. #4
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    innerHTML works in netscape 6 but not 4

    Code:
    document.getElementById("objectid").innerHTML='newdata';
    Try this cross browser code that I use.

    Code:
    function writeText(objectID,txt){
      if (document.getElementById){
        document.getElementById(objectID).innerHTML=txt;
      }else if (document.all){
        document.all(objectID).innerHTML=txt;
      }else if (document.layers){
        document.layers[objectID].document.open();
        document.layers[objectID].document.write(txt);
        document.layers[objectID].document.close();
      }
    }
    Call it like this...

    Code:
    writeText('div1','This is some text.  Ill be written to the object div1');
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    webmaster@leemccormick.com

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  5. #5
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    how could I modify this to get a script from the server. Something like http://mysite/myinnerhtml.inc .....

  6. #6
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Not sure what you mean? SSI?
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    webmaster@leemccormick.com

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

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