[英]dialog box not showing error
I`m having the following error . 我有以下错误。 Why am I having this error and how can I solve it? 为什么会有这个错误,我该如何解决?
$("SelectProject").dialog is not a function http://localhost:1419/Customer Line 57 $(“ SelectProject”)。dialog不是函数http:// localhost:1419 / Customer Line 57
$("#SelectProject").dialog is not a function http://localhost:1419/Customer Line 69 $(“#SelectProject”)。dialog不是函数http:// localhost:1419 /客户行69
My codes are as follows: 我的代码如下:
$(document).ready(function() {
$("#project_link").click(function() {
$('SelectProject').dialog('open');
return false;
});
$('#SelectProject').dialog({
autoOpen: false,
width: 800,
position: [130, 200],
buttons: {
"Cancel": function() {
$(this).dialog("close");
},
"Accept": function() {
$(this).dialog("close");
}
}
});
Did you include the jQuery UI script file? 您是否包含了jQuery UI脚本文件? "dialog()" is the jQuery UI method. “ dialog()”是jQuery UI方法。
You can include this library like this: 您可以像这样包含此库:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
This tag you need to put in the <head> section of you html document. 您需要将该标签放入html文档的<head>部分。
Also, your selector in your click function looks wrong it should be: 另外,您的点击功能中的选择器看起来应该是错误的:
$('#SelectProject').dialog('open');
(Assuming the element has an id of SelectProject) (假设元素的ID为SelectProject)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.