当前位置:编程学习 > C#/ASP.NET >>

请教Fckeditor加载问题

如下代码,为什么在document的ready事件中就报FCKeditorAPI未定义的错误,而下面按钮的点击事件就没有这个问题?

我现在有些和FCKeditor有关的操作希望能在页面加载的时候执行,所以肯定不能等到点按钮,所以请教此问题是否能解决?或者在其他的事件中解决?


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="static/js/jquery-1.4.1.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div>
            <input name="fckContent" type="hidden" id="fckContent" runat="server" />
            <input type="hidden" id="fckContent___Config" value="" />
            <iframe id="fckContent___Frame" name="fckContent___Frame" src="FCKeditor/editor/fckeditor.html?InstanceName=fckContent&Toolbar=cms"
                width="700px" height="360px" frameborder="no" scrolling="no"></iframe>
        </div>
        <div>
            <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
        </div>
    </div>
    </form>
    <script language="javascript" type="text/javascript">
// <![CDATA[
        $(document).ready(function () {
            var oEditor = FCKeditorAPI.GetInstance('fckContent');
            var str = oEditor.GetXHTML();
            alert(str);
        });

        function Button1_onclick() {
            var oEditor = FCKeditorAPI.GetInstance('fckContent');
            var str = oEditor.GetXHTML();
            alert(str);
        }

// ]]>
    </script>
</body>
</html>

--------------------编程问答-------------------- 库粼粼,库鲁鲁。 --------------------编程问答-------------------- 要等页面加载完才能调用。。

--------------------编程问答-------------------- 孔孔孔,等等等 --------------------编程问答-------------------- 顶一下 --------------------编程问答-------------------- 同意子夜的说法! --------------------编程问答-------------------- 再顶一下,是否有可以在$(document).ready事件之后,但在页面显示之前可以获得FCKeditor值得方式? --------------------编程问答-------------------- 应该是放在onload事件里面的
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,