我用 var content = $("#FCKeditor1").val()
获取不到查看过源文件,editor的id是FCkeditor求赐教

解决方案 »

  1.   

    当然取不到,id=FCKeditor1的内容在提交时才产生你可以看看他的样例代码
      

  2.   

    用firebug跟踪一下。输入内容,看能不能看到内容。
      

  3.   

    我是在submit之后才取值的,网上看了很多办法,不太明白
      

  4.   

    function getEditorHTMLContents(EditorName)
    {
    var oEditor = FCKeditorAPI.GetInstance(EditorName);
    return(oEditor.GetXHTML(true));
    }
    //获取编辑器中文字内容
    function getEditorTextContents(EditorName)
    {
    var oEditor = FCKeditorAPI.GetInstance(EditorName);
    return(oEditor.EditorDocument.body.innerText);
    }
    //设置编辑器中内容
    function SetEditorContents(EditorName, ContentStr)
    {
    var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
    oEditor.SetHTML(ContentStr) ;
    }
    ……