主题: 如果用了母版如何调用kindEditor,请指导。
作者: lbnt_1982, 发布日期: 2010-04-20 14:20:44, 浏览数: 7032

我按照方法将代码加入到了MasterPage中的<head></head>标签,但是运行程序后提示“Microsoft JScript 运行时错误: 'KE' 未定义”,是何原因?

母版部分代码:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><%=Idcwest.Configuration.Config.AppSettings("ProductName")%> <%=Idcwest.Configuration.Config.AppSettings("Version")%></title>
<script type="text/javascript" charset="utf-8" src="/editor/kindeditor.js"></script><script type="text/javascript">KE.show({ id: 'TextBox11' });</script>
<script src="js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="js/calendar_3.js" type="text/javascript"></script>                                                                                                                                                                                                               
<link href="img/style.css" type="text/css" rel="stylesheet"/>
</head>

调用页面代码

       <asp:TextBox ID="TextBox11" runat="server"
                    Height="152px" TextMode="MultiLine" Width="554px"></asp:TextBox>

作者: lbnt_1982, 发布日期: 2010-04-26 13:23:50
Microsoft JScript 运行时错误: 'style' 为空或不是对象


KE.create = function(id, mode) {
 if (KE.g[id].beforeCreate) KE.g[id].beforeCreate(id);
 if (KE.browser.IE && KE.browser.VERSION < 7) try { document.execCommand('BackgroundImageCache', false, true); }catch(e){}
 var srcTextarea = KE.$(id) || document.getElementsByName(id)[0];
 mode = (typeof mode == "undefined") ? 0 : mode;
 if (mode == 0 && KE.g[id].container) return;
 var width = KE.g[id].width || srcTextarea.style.width || srcTextarea.offsetWidth + 'px';
报错!
回复
作者: niu90, 发布日期: 2010-04-29 12:50:17
<script type="text/javascript">KE.show({ id: 'TextBox11' });</script>写在页面最后
回复
作者: Roddy, 发布日期: 2010-04-29 13:07:00
应该是textarea的id和其它DOM元素的id重复引起的问题。
回复
发表新帖 发表回复