Monday, May 18, 2009

closing script tag issue while document.write js

CS1010: Newline in Constant" Error Message When a String Contains a </script> Tag in the Inline Code

var f=document.open('',.......);
//if you write </script> like this you will get this error message.
f.document.write("<script>hai</script>");
It has to be written like
f.document.write("<script>hai<");
f.document.write("/script>")

so now it will work.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;827420

No comments: