Javascript tinymce setcontent的不同输出,采用原始格式或默认格式
为什么tinymce上的以下示例有不同的输出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
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);
您可以在上看到一个工作示例