使用带有getData的CKEditor 3的奇怪行为

时间:2010-04-16 15:15:37

标签: asp.net jquery ckeditor

每当我在我的CKEditor上调用getData()时,它返回一些似乎是服务器生成的脚本标签,并且它在occaision上也返回了firebug div,这看起来有点奇怪。所以我不认为它与asp具体相关,但不确定

<script type="text/javascript">  

$(function() {
  if (queryString["fxml"]) {
    $("#ckeditorPH").css("display","block").ckeditor();  
  }  
});  
CKEDITOR.plugins.registered['save'] = {
  init: function(editor) {
            var command = editor.addCommand('save', {
                modes: {
                    wysiwyg: 1, source: 1
                },
                exec: function(editor) {
                    var $ck = $("#ckeditorPH").ckeditorGet();
                    $ck.updateElement();
                    $("#ckeContent").text($ck.getData()).html();
                }
            }
            );
            editor.ui.addButton('Save', { label: 'Save', command: 'save' });
   }
}
</script>


<asp:Content ID="Content3" ContentPlaceHolderID="CPmainContent" Runat="Server">
    <textarea id="ckeditorPH" style="display: none;" name="ckEditorPh" cols="1" rows="3"></textarea>
    <div id="ckeContent"></div>
</asp:Content>

一些示例返回代码

<div id="footer">  
asdsdasdasd</div> 
<script type="text/javascript"> 
//<![CDATA[ var ctl00_ctl02_ImageArray =  new Array('', '', '', '/Wiki WebResource.axd?d=orvFyKxqjn_MxWN6EePxi9qdFITpyPFIgsCG-7yiV981&t=634031320320031812', '/Wiki/WebResource.axd?d=orvFyKxqjn_MxWN6EePxiziK9rrZZZfuENrSUk7FQmY1&t=634031320320031812', 
'/Wiki/WebResource.axd?d=orvFyKxqjn_MxWN6EePxixV5Wtl1sjTWzAxt10NTBqE1&t=634031320320031812');  
//]]>  
</script>  
<script type="text/javascript"> 
//<![CDATA[  
WebForm_InitCallback();  
var ctl00_ctl02_Data = new Object(); 
ctl00_ctl02_Data.images = ctl00_ctl02_ImageArray;  
ctl00_ctl02_Data.collapseToolTip = "Collapse {0}";  
ctl00_ctl02_Data.expandToolTip = "Expand {0}";  
ctl00_ctl02_Data.expandState = theForm.elements['ctl00_ctl02_ExpandState'];  
ctl00_ctl02_Data.selectedNodeID = theForm.elements['ctl00_ctl02_SelectedNode'];  
for (var i=0;i<6;i++) {  
var preLoad = new Image();  
if (ctl00_ctl02_ImageArray[i].length > 0)  
preLoad.src = ctl00_ctl02_ImageArray[i];  
}  
ctl00_ctl02_Data.lastIndex = 4;  
ctl00_ctl02_Data.populateLog = theForm.elements['ctl00_ctl02_PopulateLog'];  
ctl00_ctl02_Data.treeViewID = 'ctl00$ctl02';  
ctl00_ctl02_Data.name = 'ctl00_ctl02_Data';  
//]]>  
</script>

1 个答案:

答案 0 :(得分:0)

Firebug元素是由于以前版本的Firebug中出现问题而最新的1.6版本修复了它。

对于其余的脚本:我从未见过类似的东西。