当我明确地在我的$(文档)之前包含jQuery库时,我无法弄清楚为什么它仍然没有识别jQuery语法.ready
<!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 id="Head1"><title>
</title></head>
<body>
<form name="form1" method="post" action="jQueryDialogTest.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZA==" />
</div>
<script src="content/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="content/js/popup.js" type="text/javascript"></script>
<div id="testDialog" winWidth="400" winHeight="500" winResizable="true">
Some test mark-up, should show inside the dialog
</div>
<div><input type="button" id="invokeDialog" value="Click Me!" /></div>
</form>
<script type="text/javascript">
$(document).ready(function()
{
$("input.invokeDialog").click.showDialog("#testDialog");
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在popup.js我有这样的例子:
function showDialog(divID)
{
// Get reference to the div element
var dialogDiv = $(divID);
dialogDiv.dialog
(
{
bgiframe: true,
modal: true,
autoOpen: false,
show: 'blind'
}
)
dialogDiv.dialog("open");
}
Run Code Online (Sandbox Code Playgroud)
你确定它实际上正在加载javascript文件吗?像"Fiddler"这样的工具可以帮助您确定这一点.
此外,您的代码未正确终止,这可能会导致奇怪的错误.试试这个:
$(document).ready(function()
{
$("input.invokeDialog").click.showDialog("#testDialog");
}
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2110 次 |
| 最近记录: |