Forum Moderators: open
<script language="JavaScript">
document.write('
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="142" height="85">
<param name="movie" value="/adverts/movie1.swf">
<param name="quality" value="high">
<embed src="/adverts/movie1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="142" height="85"></embed>
</object>
');
</script>
document.write('stuff to write'+
'another line of stuff'+
'still more stuff'+
'etc.');
What is screwing things up without the concatenation operator (the +) is JavaScript's automatic insertion of statement terminators (the semicolon, ;) at line endings. It's a case of the interpreter being too clever for its own good. Java, it should be stated, doesn't do this.
However it does not validate for some reason :(
I am getting...
end tag for element "EMBED" which is not open
end tag for element "OBJECT" which is not open
...both way after the js has ended.
Anyone have any idea why?