Javascript ckeditor使后续脚本中以@为前缀的注释作为IE 10中的代码执行
我有一个HTML页面,如:Javascript ckeditor使后续脚本中以@为前缀的注释作为IE 10中的代码执行,javascript,ckeditor,internet-explorer-10,Javascript,Ckeditor,Internet Explorer 10,我有一个HTML页面,如: <html> <head> <title>Test Page</title> <script type="text/javascript" src="http://svn.ckeditor.com/CKEditor/releases/latest/ckeditor_basic_source.js"></script> <script type="text/
<html>
<head>
<title>Test Page</title>
<script type="text/javascript"
src="http://svn.ckeditor.com/CKEditor/releases/latest/ckeditor_basic_source.js"></script>
<script type="text/javascript">
//@x=y
</script>
</head>
<body>
Test Page
</body>
</html>
如果我删除了
/*@cc\u on@*/代码>注释,一切正常。我认为这是由CKEditor中包含的条件编译语句造成的。如果设置了/*@cc_on@*/
,IE10会将/@
后面的部分识别为它应该执行的JavaScript代码。jQuery团队遇到了这个bug的一个变体。将/@
部分包装在块注释中,如/*/@x=y*/
可以解决问题
CKEditor团队已就此提交了一份声明。我在IE10上收到关于加载脚本或ActiveX控件的警告,它要求我单击“允许访问”以使其工作。我猜这与CKEditor执行文档有关。write(“”)
@BradM是的,我认为,加载了其余的CK模块。如果@
直接出现在/
或/*
之后,它似乎就变成了注释终止符。这真的很奇怪。我在CKEditor论坛上交叉发布过:
if ( !CKEDITOR.env )
{
/**
* @namespace Environment and browser information.
*/
CKEDITOR.env = (function()
{
var agent = navigator.userAgent.toLowerCase();
var opera = window.opera;
var env =
/** @lends CKEDITOR.env */
{
/**
* Indicates that CKEditor is running on Internet Explorer.
* @type Boolean
* @example
* if ( CKEDITOR.env.ie )
* alert( "I'm on IE!" );
*/
ie : /*@cc_on!@*/false,
...