[英]jquery-ui.js:12443 Uncaught TypeError: Cannot read property 'apply' of undefined
I have written this code in my project and it is displaying the error: 我在我的项目中编写了这段代码并显示错误:
Uncaught TypeError: Cannot read property 'apply' of undefined
未捕获的TypeError:无法读取未定义的属性“apply”
if (TempData["notice"] != null)
{
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" type="text/css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<p id="dialog" style="color:red">
@TempData["notice"]<br />
<button id="bclose">Ok</button>
</p>
<script language="javascript">
$('#dialog').dialog({
dialogClass: "no-close",
buttons: [{
text: "Ok",
Click: function() {
$('#dialog').dialog('close');
}
}]
});
</script>
}
DO I need to add any library for the above code 我需要为上面的代码添加任何库
Put your script section into: 将您的脚本部分放入:
$(document).ready(function(){
//your script here
});
Something like this: 像这样的东西:
<script language="javascript">
$(document).ready(function(){
$('#dialog').dialog({
dialogClass: "no-close",
buttons: [{
text: "Ok",
click: function() {
$('#dialog').dialog('close');
}
}]
});
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.