[thelist] document.write

Joshua Olson joshua at alphashop.net
Sun Jun 17 16:01:42 CDT 2001


document.write() will overwrite the document if the document is already done
rendering.  So, it should be used not within a function, OR, within a
function that is called as the page is loaded.  So, this should be okay

<script language="JavaScript">
  function myfunct()
  {
    document.write('Hello, world.');
  }

  myfunct();
</script>

Where as calling myfunct from

<input type="button" value="click me" onclick="myfunct(); return false;">

will have undesirable results.

HTH,

-joshua

-----Original Message-----
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Matthew Lockwood
Sent: Sunday, June 17, 2001 1:42 PM
Subject: [thelist] document.write


does anyone know how to solve the problem of using document.write in
functions??
I have just done that and found that it opens a new page and only writes the
stuff inside the brackets after the document.write.... which isn't what I
want at all.

Is there any special way to stop this from happening or can you just simply
not do this in functions.

cheers

M@





More information about the thelist mailing list