VK said the following on 7/31/2005 8:37 AM:
> Russ wrote:
>
>>Hi All,
>>I have a problem getting the following simple example
>>of "document.write" creating a script on the fly
>>to work in all html browsers.
>>It works in I.E., Firefox, and Netscape 7 above.
>>It doesn't seem to work in Netscape 4. Am I missing
>>something with it? When I look at page source in
>>Netscape 4 the script isn't even shown.
>>Can Netscape 4 create scripts on the fly at all?
>
>
> As DevEdge went to hell knows where, you have to accept my weak memory
> :-)
> NN4 do not parse (so doesn't execute) JavaScript inserted into another
> page or layer ising document.write()
Actually, it did. You could dynamically load a script, or external
script file, by opening a layer, write to it, and close the layer.
> The work around would be to put your script into myScript.js file. NN4
> also stops parsing as soon as it sees '<script>' string in write()
> statement. But you can cheat it rather easily by doing:
>
> document.write('<scr');
> document.write('ipt src="myScript.js">');
> document.write('</scr');
> document.write('ipt>');
I have never seen, nor do I remember, that ever being a problem. But all
it would take is an escape in the <\/script> tag to cure that problem.
Why make it harder than it has to be?
> The other known bug in NN4 was that any language indications were
> ignored if an external script file was used. So don't bother with
> "language" or "type".
That's not good advice to give. Always use the type attribute and let
the browser deal with it how it wants. Do not produce invalid code just
because one ancient browser ignores it.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Received on Tue Oct 18 03:03:59 2005