Javascript 无法获取未定义或空引用的属性“contentWindow”
我有一个引导模式中的Ajax编辑器。第一次打开模式时,它运行正常,下一次打开工具栏时,它不再存在,并抛出此错误。你知道会发生什么吗 谢谢Javascript 无法获取未定义或空引用的属性“contentWindow”,javascript,ajax,twitter-bootstrap,Javascript,Ajax,Twitter Bootstrap,我有一个引导模式中的Ajax编辑器。第一次打开模式时,它运行正常,下一次打开工具栏时,它不再存在,并抛出此错误。你知道会发生什么吗 谢谢 Unhandled exception at line 84, column 9 in http://localhost:53818/ScriptResource.axd?d=QnqJUlWX76vy-voPv0SOyeWuqjSyItje2m_RwWfpN9Dp9KL-kVEuy2eIP-IxAD4LMlqvG3esYD48cWHYJvzAF9a1YRm5X
Unhandled exception at line 84, column 9 in http://localhost:53818/ScriptResource.axd?d=QnqJUlWX76vy-voPv0SOyeWuqjSyItje2m_RwWfpN9Dp9KL-kVEuy2eIP-IxAD4LMlqvG3esYD48cWHYJvzAF9a1YRm5XmxfCzWi0PaDVAfNV8mz4aOOLZVDVbMrKXACgpSJB28TI_zeX-HTr-9ysw2&t=ffffffffda74082d
ScriptResource.axd-this中出现错误。_doc=this.get_element.contentWindow.document
_initIframe: function(value) {
if (!Sys.Extended.UI.HTMLEditor.isIE) {
this._savedValue = value;
this._absAndFixedParents = this._getAbsAndFixedParents();
}
var str = Sys.Extended.UI.HTMLEditor.Trim(this._prepareContent(value));
this._doc = this.get_element().contentWindow.document;
if (!Sys.Extended.UI.HTMLEditor.isIE) {
this._doc.designMode = "on";
}
这是模态
<div id="modalEventsEditor" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<asp:UpdatePanel ID="EventsUpdatePanel" runat="server">
<ContentTemplate>
<div class="modal-header">
<button class="close" aria-hidden="true" type="button" data-dismiss="modal">×</button>
<h4 class="modal-title">Events</h4>
</div>
<div class="modal-body">
<div role="form">
<fieldset>
<div id="eventDateDiv" class="form-group">
<label id="eventDateLabel" for="inputEventDate">Date</label>
<asp:TextBox ID="inputEventDate" CssClass="form-control" placeholder="The Date of the event" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender runat="server" TargetControlID="inputEventDate"></ajaxToolkit:CalendarExtender>
</div>
<div id="eventTimeDiv" class="form-group">
<label id="eventTimeLabel" for="inputEventTime">Time</label>
<input id="inputEventTime" class="form-control" runat="server" type="text" placeholder="The Time of the event" />
</div>
<div id="eventAuthorDiv" class="form-group">
<label id="eventAuthorLabel" for="inputEventAuthor">Author</label>
<input id="inputEventAuthor" runat="server" class="form-control" type="text" placeholder="The Author of this notice" />
</div>
<div id="eventTitleDiv" class="form-group">
<label id="eventTitleLabel" for="inputEventTitle">Title</label>
<input id="inputEventTitle" runat="server" class="form-control" type="text" placeholder="The Title of this notice" />
</div>
</fieldset>
</div>
<div id="editorContainer">
<cc1:Editor ID="Editor1" runat="server" />
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
<button id="modalEventsEditorButton" runat="server" class="btn btn-primary" type="button">Save changes</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
看来MS Ajax异步编辑器控件不是异步的!!差不多和众所周知的巧克力消防队员一样好
当微软asp.net论坛使用TinyMCE时,我走上了这条路。使用Modal有点头疼,但最终还是解决了——如果有人想要这个方法,请留言,我会发布代码,我也遇到了同样的问题;有点我在tabcontainer中有一个编辑器,第一次进入选项卡时,编辑器已加载。我将转到另一个选项卡并再次返回,它将在中第84行第9列的未处理异常中失败。对于我的解决方案,我关闭了tabContainer上的autoPostBack 回到你曾经是程序员的那一天;现在你是一个财产骑师…这都是巫毒