我对 jQuery 很陌生,不知道什么不起作用。
在以下示例中,当页面是 asp Web 应用程序的一部分时,代码可以正常工作。
但是当我在 IIS 中创建一个正常的网站时,负载不起作用。事件引发(通过警报尝试)但没有加载任何内容。
我假设 jScript ( jQuery ) 是独立的表单主机机制。我错了吗?
<!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>
<script src="../../Scripts/jquery-1.5.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#MyButton').click(function () {
//Load HTML from HelpDetails.html
$('#OutputDiv').load('../HelpDetails.html #SubTOC');
});
});
</script>
</head>
<body>
<button id="MyButton">Click to Get HTML</button>
<div id="OutputDiv"></div>
</body>
</html>