Closed Thread Icon

Preserved Topic: Writing like ya got a pair.... (of layers... what did you think I was talking about?) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18461" title="Pages that link to Preserved Topic: Writing like ya got a pair.... (of layers... what did you think I was talking about?) (Page 1 of 1)" rel="nofollow" >Preserved Topic: Writing like ya got a pair.... (of layers... what did you think I was talking about?) <span class="small">(Page 1 of 1)</span>\

 
Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 11-18-2001 04:44

um.... anyone know how the 'document.writeIn' thingy works?

tskull@hotmail.com">
"You don't have to be crazy to work here, but it helps." --Anonymous
ICQ: 67751342

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 11-18-2001 04:46

That's writeln, with a lowercase L, not an uppercase I. =) It's the same as doc.write only it adds a newline character to the end of what it writes.

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 11-18-2001 04:58

oh, no wonder it never works. So, what this does it basically append the value (I.E. writein(value)) to the end of the file as if you wrote it in there in the first place?

tskull@hotmail.com">
"You don't have to be crazy to work here, but it helps." --Anonymous
ICQ: 67751342

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 11-18-2001 05:24

Er, no.

Well, first of all, you miswrote it again =) it's writeln not writein. There's no I in there anywhere. =)

Second, it behaves like this:

document.writeln('hi');

is exactly the same as

document.write('hi\n');

But here's how both of them work... if you use them while the page is still parsing, then they just write into the document where the script tags are. So

<body>
stuff
<script>document.write('morestuff');</script>
stuff
</body>

is just as though you wrote this:

<body>
stuffmorestuffstuff
</body>

If, however, you use document.write *after* the page has loaded, then it doesn't do anything until you say document.close(). At that point, all that you've written completely replaces the source code, as if a new page was loaded, sorta.

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 11-18-2001 15:24

shite! meant to write it correctly, I swear....

So, I can't dynamically create layers and text after the page is done loading?

and if I wrote:

<body>
stuff
<script>document.writeln('morestuff');</script>
stuff
</body>

would it be as if I wrote:

<body>
stuff<BR>morestuff<BR>stuff
</body>

?

You know where I can look into this (and other) JS functions?


"You don't have to be crazy to work here, but it helps." --Anonymous
ICQ: 67751342


[This message has been edited by Petskull (edited 11-18-2001).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 11-18-2001 19:40

No, no, the writeln function doesn't add "<br>" to the end of what you wrote, it only adds a new line character. This doesn't even have any effect in most cases, since

<body>
stuff
<script>document.writeln('hi')</script>
stuff
</body>

will translate into

<body>
stuffhi
stuff
</body>

And HTML considers line breaks to be merely whitespace. That's why the writeln function is almost never used; the output doesn't *look* any different.

As for writing layers dynamically? Well, you can do that in standards-compliant browsers, at least. It's sorta weird though, I haven't looked into it too much.

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 11-18-2001 21:09

that's what I was saying, I was only asking if the writeln added a line break before as well as after?

tskull@hotmail.com">
"You don't have to be crazy to work here, but it helps." --Anonymous
ICQ: 67751342

« BackwardsOnwards »

Show Forum Drop Down Menu