3
我有這樣的PICE JavaScript代碼,加載它包含了邏輯上工作的div一個html文件。這是一個應該包含在多個頁面中的彈出式窗口。負載完全不會被調用
我已經用在其他地方成功完全相同的方法。
的問題是,完整的方法不會被調用,當我登錄與服務器的交互瀏覽器,沒有發出的呼叫。
這是IE9和FF16一樣。
你有一個提示,以進一步給我?
TIA :)
function defineEditDocumentWindow(divTag) {
assert($(divTag));
assert(UrlExists('/Documents/EditDocument.htm'));
$(divTag).load('/Documents/EditDocument.htm', null, function (response, status, xhr) {
alert('hey, we were called');
if (status == "error") {
debugger;
} else {
debugger;
var width = 1500;
var height = 800;
var initWidgets = function (tab) {
switch (tab) {
case 0:
break;
case 1:
initializePreview();
break;
}
};
$('#jqxTabDocumentEditPreview').jqxTabs({ height: 700, width: 1480, theme: 'classic', initTabContent: initWidgets });
$('#jqxEditDocumentWindow').jqxWindow({ height: height, maxHeight: height, width: width, maxWidth: width, theme: 'classic', autoOpen: true, isModal: true, animationType: 'none' });
$('#jqxTabDocumentEditPreview').jqxTabs({ keyboardNavigation: false });
$('#jqxTabDocumentEditPreview').bind('selected', function (event) {
initializePreview(event);
});
}
});
}
HTML:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="T24Portal.Test" %>
<!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">
<script type="text/javascript" src="ScriptsExternal/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="Scripts/WaitSignUtil.js"></script>
<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="jqwidgets/styles/jqx.classic.css" type="text/css" />
<link rel="stylesheet" href="jqwidgets/styles/jqx.classic.css" type="text/css" />
<script type="text/javascript" src="/Documents/EditDocument.Main.js"></script>
<script type="text/javascript" src="ScriptsExternal/ba-debug.js"></script>
<script type="text/javascript" src="ScriptsExternal/json2.js"></script>
<script type="text/javascript" src="ScriptsExternal/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="jqwidgets/jqx-all.js"></script>
<script type="text/javascript" src="ScriptsExternal/showdown.js"></script>
<script type="text/javascript" src="/Scripts/AvalonUtil.js"></script>
<script type="text/javascript">
$(document).ready(function() {
defineEditDocumentWindow("EditDocumentWindowPlaceHolder");
});
</script>
<style type="text/css">
</style>
</head>
<body>
<div id="EditDocumentWindowPlaceHolder">
</div>
</body>
</html>
你有在調試控制檯(F12)的錯誤? – sdespont
不,沒有。它看起來好像被忽略:) –
唯一的解決方案是divTag不能與現有的div元素相對應。什麼是你的divTag變量的字符串?它應該像「#myDiv」=>'$(「#myDiv」)。load()' – sdespont