首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

怎么获取iframe里面的Fckeditor的值

2012-08-24 
如何获取iframe里面的Fckeditor的值由于在FCKeditor的标签中,并没有支持html中一些事件,如何直接利用js获

如何获取iframe里面的Fckeditor的值

由于在FCKeditor的标签中,并没有支持html中一些事件,如何直接利用js获取其中的值就
成为了一个问题。
思路:在含有Fckeditor的页面中利用FCKeditor自动加载的js函数将获取内容的改值传递到一个hidden里面去,再在父页面中利用js获取hidden的值,从而实现对表单的提交

iframe页面:

<script type="text/javascript">//FCK会自动加载此函数function FCKeditor_OnComplete(editorInstance ){   editorInstance.Events.AttachEvent('OnBlur',checkTextValue ) ;  }//检查输入框的情况 function checkTextValue(){  var introducevalue=FCKeditorAPI.GetInstance("EditorDefault").EditorDocument.body.innerText;        //alert(introducevalue);     document.getElementById("hidden").value=introducevalue;    if(introducevalue==""){       alert("内容不能为空");     }  } </script>父页面;<script type="text/javascript">function check(){alert(window.frames["qq"].document.getElementById("hidden").innerHTML);}</script>


热点排行