...

View Full Version : Document.write



JAVAEOC
02-01-2004, 05:27 PM
how can i document.write this:

document.write("<script src='bla.js'></script>")

?

fredmv
02-01-2004, 06:16 PM
Originally posted by JAVAEOC
document.write("<script src='bla.js'><\/script>")

JAVAEOC
02-01-2004, 07:01 PM
how is that? what does that do?

liorean
02-01-2004, 07:06 PM
The script is ended by the first occurence of </ after the start tag. (Though some browsers wrongly ends it only if it happens to be a </script> end tag.)

The backslash escapes the slash, which doesn't mean a yota of difference for JavaScript, but means that the HTML parser doesn't encounter a </ sequence.

JAVAEOC
02-02-2004, 03:25 AM
ohh ok

thx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum