尝试使用以下代码清除并加载新内容到tinyMce时,遇到问题:
tinymce.activeEditor.setContent('') ,在IE9和IE10中会显示一个错误IndexSizeError。
SCRIPT5022: DOM Exception: INDEX_SIZE_ERR (1)
tinymce.min.js, line 9 character 6620
SCRIPT5022: DOM Exception: INDEX_SIZE_ERR (1)
tinymce.min.js, line 5 character 19251
我的代码:
$(document).on('change','#MerchantsEmailMarketing_email_promotion_deal_id',function(){
$("#LoadingImage").show();
var dealId=$(this).val();
var emailBody = tinyMCE.activeEditor.getContent();
if(dealId =="") {
if(emailBody.length > 0){
tinymce.activeEditor.setContent('');
}
$("#LoadingImage").hide();
return false;
}
var data={dealId:dealId}
if(emailBody.length > 0){
tinymce.activeEditor.setContent('');
}
$.ajax({
url:'<?php echo Yii::app()->createAbsoluteUrl('admin/loadDealEmailTemplate')?>',
type:'post',
dataType:'json',
data:data,
success:function(result){
tinymce.activeEditor.execCommand('mceInsertContent',true, result.content);
tinymce.activeEditor.isNotDirty = 1;
$("#LoadingImage").hide();
}
});
});
请帮助我解决这个问题。