我有以下页面
<html>
<head>
<script type="text/javascript" src="e01.js"></script>
</head>
<body>
<script type="text/javascript">
var obj={someHTML: "<script>alert('a');</script>rest of the html",
someOtherAttribute:"some value"};
alert(obj.someHTML);
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在我的对象的someHTML属性中,我有</script>一个字符串中的标记.但是浏览器将其读作实际的关闭标记并关闭脚本元素.这里有什么我想念的吗?(用ff和chrome试过)