Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript tinymce setcontent的不同输出,采用原始格式或默认格式_Javascript_Jquery_Html_Format_Tinymce - Fatal编程技术网

Javascript tinymce setcontent的不同输出,采用原始格式或默认格式

Javascript tinymce setcontent的不同输出,采用原始格式或默认格式,javascript,jquery,html,format,tinymce,Javascript,Jquery,Html,Format,Tinymce,为什么tinymce上的以下示例有不同的输出 var foo = '<html><head></head><body><p></p>xxxxx'; // generates some empty lines and the content tinymce.activeEditor.setContent(foo); // the content starts from the top, without any lines

为什么tinymce上的以下示例有不同的输出

var foo = '<html><head></head><body><p></p>xxxxx';

// generates some empty lines and the content
tinymce.activeEditor.setContent(foo);

// the content starts from the top, without any lines
tinymce.activeEditor.setContent(foo, {format : 'raw'});

// generates the same (without any empty line, like raw format)
$(tinymce.activeEditor.getBody()).html(foo);
var foo='

xxxxx'; //生成一些空行和内容 tinymce.activeEditor.setContent(foo); //内容从顶部开始,没有任何行 setContent(foo,{format:'raw'}); //生成相同的(没有任何空行,如原始格式) $(tinymce.activeEditor.getBody()).html(foo);
您可以在上看到一个工作示例