[Javascript] document.write from a global variable.

Troy III Ajnej trojani2000 at hotmail.com
Mon Sep 6 10:39:29 CDT 2004


Yeah, this is complete and correct answer


>From: Flavio Gomes <flavio at economisa.com.br>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: "[JavaScript List]" <javascript at LaTech.edu>
>Subject: Re: [Javascript] document.write from a global variable.
>Date: Mon, 06 Sep 2004 09:40:05 -0300
>
>>I don't know what you are talking about here.. javascript is interpreted 
>>along with html.. Exactly on the place after an html tag where you have 
>>included a document.write() statement, the html code will be dynamically 
>>included. A second document.write() will simply be appended to the rest of 
>>the html code... And that's just the way it is..
>
>
>This will append my_variable to the the code:
>
><script language="JavaScript">
>var my_variable = "There's some kind of content here.";
>
>document.write(my_variable);
></script>
>
>
>This will overwrite all you document code:
>
><script language="JavaScript">
>  setTimeout("document.write(my_variable);", 2000);
></script>
>
>
>
>document.write will only overwrite the document when it's already loaded. 
>("onload=document.write" will append to the end)
>
>
>--
>Flavio Gomes
>flavio at economisa.com.br
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Javascript mailing list