Possible Duplicate:
Why split the <script> tag when writing it with document.write()?
Browsing through some Chromium source (see line 45ff), I found:
in_script_tag: function(code) {
return "<script>" + code + "</scr" + "ipt>";
},
Does anyone know why the author chose "</scr" + "ipt>" over "</script>"?
Inside a
<script>tag</script>ends it, no matter where it occurs.Example:
The reason for this is simply that the browser does not know anything about JavaScript strings etc. so when it sees
</script>it always closes the<script>tag.