Closed Thread Icon

Preserved Topic: Why ooo god why Pages that link to <a href="https://ozoneasylum.com/backlink?for=18237" title="Pages that link to Preserved Topic: Why ooo god why" rel="nofollow" >Preserved Topic: Why ooo god why\

 
Author Thread
Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 08-14-2001 21:47

Hi, when i write the comand document.write('bla bla bla');
the page turns white and it's writen bla bla bla on it,

but how can i write to the the page, widout clearing the page?




mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 08-14-2001 21:54

innerHTML
innerText
outerHTML
outerText
insertAdjacentHTML
insertAdjacentText
TextRange object
NOTE OF IMPORTANCE: These are not supported in some browsers. I would tell you which browsers do what, but I always seem to get it wrong...proceed at your own risk.

Bugimus and I had this discussion some time ago...it turned into a great thread. Sadly, I can't seem to find it.
Bug, do you remember where we put that???

mobrul

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-14-2001 21:54

Well, if you put your text inside the page like this

text

<script ... >
document.write('blah blah');
</script>

text

you'll get a page that says "text blah blah text".

*BUT*, if you doc.write *after* the page has finished parsing, then it will overwrite everything.

If you want to change page content after it's loaded, do it like this:

<div id="thistextcanbechanged">blah blah</div>

<script ... >
function myfunc()
{
document.getElementById("thistextcanbechanged").innerHTML = 'new blah blah';
}
</script>

That will work in browsers that support the correct DOM - IE 5, Netscape 6, Mozilla.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-14-2001 23:02

Try this:
http://javascript.internet.com/bgeffects/write-layer.html

I think it might be what you are looking for.

Emps

Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 08-14-2001 23:06

Thanks, but I think I have seen a solution that works in older browser to, I?m not sure were and i?m not sure how to do this



[This message has been edited by Osaires (edited 08-14-2001).]

Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 08-14-2001 23:10

Isn?t it strange that this is so hard to do, it a easy thing is sold be easy




[This message has been edited by Osaires (edited 08-14-2001).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-14-2001 23:18

Well, in IE 4, you can use the same DIV with the following JavaScript code to change it:

document.all.thistextcanbechanged.innerHTML = 'new blah blah';

and in NN 4.x you can do this:

document.thistextcanbechanged.document.write('new blah blah');
document.thistextcanbechanged.document.close();
// loses any formatting created by style sheets in the original DIV tag

Otherwise, I don't think there's a way to change text content once the page has loaded...

Osaires
Paranoid (IV) Inmate

From: oslo, Norway
Insane since: Aug 2001

posted posted 08-14-2001 23:26

Thanks, slime you always got god answers to my questions



mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 08-15-2001 07:00

wow!
Slime's at god-like status now...

(still looking for that earlier thread...BUG! HEY BUGIMUS! Are you out there? Any help?)
mobrul


mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-15-2001 08:03

Mobrul, her's that link: http://www.ozoneasylum.com/Forum2/HTML/000695.html

mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 08-15-2001 14:43

Thanks!!
(Uh, looks like the memory isn't so good these days. Thought I had that conversation with Bugs...seems that he wasn't even involved...sorry Bugimus, and linear, and everybody else that was involved...)
Mr. Max to the rescue again.

mobrul

« BackwardsOnwards »

Show Forum Drop Down Menu