我有一些javascript加载一个html文件,其中包含逻辑工作的div。这是一个popop窗口,应该包含在多个页面中。
我在其他地方使用过完全相同的方法。
问题是从不调用complete方法,当我记录浏览器与服务器的交互时,没有调用。
在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>
答案 0 :(得分:0)
完成此Q / A ...未正确使用正确的选择器。
函数调用:
defineEditDocumentWindow("EditDocumentWindowPlaceHolder");
应该是:
defineEditDocumentWindow("#EditDocumentWindowPlaceHolder");
错过了主要的哈希标记。