3

我的页面上有 TinyMCE 控件(asp.net 页面)。我正在尝试编辑 html 并插入嵌入标签,但是一旦我切换到所见即所得模式,然后回到 html 编辑模式,我可以看到嵌入标签已被清除,并添加为新的 PARAM 内联标签对象标签。这是示例html

<OBJECT id=ETFflash1016 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=345 align=middle height=230>
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
<PARAM NAME="AllowFullScreenInteractive" VALUE="false">
<PARAM NAME="IsDependent" VALUE="0">
<embed src="/video/ETFflash1016.swf.cms" quality="high" bgcolor="#ffffff" width="345" height="230" name="ETFflash1016" align="left" allowScriptAccess="sameDomain" allowFullScreen="false" wmode="Transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</OBJECT>

所以这已经变成了这个

<object id="ETFflash1016" width="345" height="230" data="../../../video/ETFflash1016.swf.cms" type="application/x-shockwave-flash">
    <param name="Profile" value="0" />
<param name="ProfilePort" value="0" />
<param name="AllowNetworking" value="all" />
<param name="AllowFullScreen" value="false" />
<param name="AllowFullScreenInteractive" value="false" />
<param name="IsDependent" value="0" />
<param name="src" value="../../../video/ETFflash1016.swf.cms" />
<param name="name" value="ETFflash1016" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="Transparent" />
<param name="allowfullscreen" value="false" />
<param name="quality" value="high" />
</object>

您可能已经注意到,嵌入标签的属性变成了对象标签的参数内联标签。我在网上搜索过,主要的解决方案是添加媒体插件,将media_strict设置为false,但没有帮助,所以我继续搜索,并遇到另一个建议 - 使用extended_valid_elements但到目前为止不乏。这是我的 TinyMCE 控件的初始化函数

tinyMCE.init({
            mode: "exact",
            theme: "advanced",
            plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,spellchecker,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist",
            media_strict: "false",
            convert_urls: "false",
            theme_advanced_resizing: true,");
            onchange_callback : "HandleTinyEditorChange",
            valid_elements : "*[*]\",
            extended_valid_elements : "object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]"
            });

我做错了什么?我怎样才能使这项工作?我正在使用 TinyMCE v.3.9.2

4

1 回答 1

2

于是问题就变得可笑了。media_strict 和 convert_urls 接受布尔值而不是字符串,所以我只需将布尔值传递给这些参数而不是字符串,它就像一个魅力。

tinyMCE.init({ 
            mode: "exact", 
            theme: "advanced", 
            plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,spellchecker,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist", 
            media_strict: false, 
            convert_urls: false, 
            theme_advanced_resizing: true,"); 
            onchange_callback : "HandleTinyEditorChange", 
            valid_elements : "*[*]\", 
            extended_valid_elements : "object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]" 
            }); 
于 2012-10-21T09:49:47.057 回答