gpt4 book ai didi

javascript - 类型错误 : 'undefined' is not a function (evaluating '$( "#wnd_Addparam"). 对话框')

转载 作者:数据小太阳 更新时间:2023-10-29 05:16:19 25 4
gpt4 key购买 nike

我有 2 个月的这个例子,我换了 PC。现在这似乎不再起作用了。这是一个应该通过(之前)按下按钮来加载小窗口对话框的示例。但是,它不起作用...这是我的代码:

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
// <---- VENTAÑAS DE PARAMETERES---->

var regex,v,l,c,b;
$( "#wnd_Addparam" ).dialog({
autoOpen: false,
height: 'auto',
width: 350,
modal: true,
resizable:false,
buttons: {
"Add": function() {
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
$( this ).dialog( "close" );
}
});

$( "#btn_Addpar" ).click(function() {
$( "#wnd_Addparam" ).dialog( "open" );
});
$( "#wnd_Paramedit" ).dialog({
autoOpen: false,
height: 'auto',
width: 350,
modal: true,
resizable:false,
buttons: {
"Accept": function() {
$( this ).dialog( "close" );

},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
$( this ).dialog( "close" );
}
});

$( "#btn_Pedit" ).click(function() {
$( "#wnd_Paramedit" ).dialog( "open" );
});
$( "#wnd_Borpara" ).dialog({
autoOpen: false,
height: 'auto',
width: 300,
resizable:false,
modal: true,
buttons: {
"Accept": function() {
$(this).dialog("close");

},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
$( this ).dialog( "close" );
}
});

$( "#btn_Deletepara" ).click(function() {
$( "#wnd_Borpara" ).dialog( "open" );
});

</script></head>
<!--<form method="POST" id="iformp" name="nformp">-->
<body>
<h3>List of parameters</h3>
<div id="sortparam" >
</div>
<input type="button" id="btn_Addpar" value="Add"/>
<input type="button" id="btn_Deletepara" value="Delete"/>
<input type="button" id="btn_Pedit" value="Edit"/>
<!--<form>-->

</body>

</html>

拜托..为什么我的对话框有错误???

最佳答案

您引用的是 jQuery 核心,而不是 jQuery UI 本身。

我相信 dialog 功能只存在于 jQuery UI 中,因此您还需要将以下内容添加到您的页面:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>

<script type="text/javascript">
// <---- VENTAÑAS DE PARAMETERES---->
$(document).ready( function () {
var regex,v,l,c,b;
$( "#wnd_Addparam" ).dialog({
// Your code...
}

关于javascript - 类型错误 : 'undefined' is not a function (evaluating '$( "#wnd_Addparam"). 对话框'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12909916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com