SOggyの日記: Mozilla: JavaScript中の</script>タグのパース問題
日記 by
SOggy
改めて、表のIISを媒体にIEで閲覧するだけで感染するウィルスを眺めて、hir_000さんのコメント -> </script> tag in javascript string seen as end of script -> reduced testcaseをメモ。
- 4x browsers (both IE and Netscape) deal with </script> this way. The HTML parser does not understand JavaScript syntax, and interprets any occurrence of in a document as a closing script tag. You munge the string a bit to work around the issue. For example, document.write ("</" + "script>"); would work as expected.
- use
document.write('</SCR','IPT>');
Mozilla: JavaScript中の</script>タグのパース問題 More ログイン