[Javascript] document.write from a global variable.
Kim Hoogenberg
kim.hoogenberg at virgil.nl
Sat Sep 4 15:37:03 CDT 2004
Cutter wrote:
> How do ya figure? I use document write often in pages, placing my
> script tags right where that content may go, and it works fine for me...
>
> Cutter
>
> Troy III Ajnej wrote:
>
>>
>>
>> ...
>>
>>> <script type="text/javascript">
>>> document.write(color1);
>>> </script>
>>> <br />
>>> <script type="text/javascript">
>>> document.write(size1);
>>> </script>
>>> <br />
>>> <script type="text/javascript">
>>> document.write(color2);
>>> </script>
>>> <br />
>>> <script type="text/javascript">
>>> document.write(size2);
>>> </script>
>>> </body>
>>
>>
>> Not sure what you're really up to with that but I'm sure that the
>> 'document.write(size1)' will allways get written first and alone,
>> (color2; size2; etc., will never get that chance). The first
>> document.write command will overwrite the page along with the script
>> so the following document write, will get wiped before it ever get
>> called.
>>
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..
More information about the Javascript
mailing list