我是 jquery 的新手,我想在调用函数时向我的页面添加一个对话框。每当我从控制台调用此函数时,都会显示对话框,但出现以下错误。这是什么意思以及如何解决它?
Uncaught TypeError: a(...).parents(...).andSelf is not a function
at d (jquery-ui.min.js:5)
at c (jquery-ui.min.js:5)
at Array.tabbable (jquery-ui.min.js:5)
at jquery.min.js:2
at r (jquery.min.js:2)
at se.select (jquery.min.js:2)
at Function.se [as find] (jquery.min.js:2)
at k.fn.init.find (jquery.min.js:2)
at a.<computed>.<computed>.open (jquery-ui.min.js:5)
at a.<computed>.<computed>._init (jquery-ui.min.js:5)
我用过这些 jquery 库:
<script src="../vendor/jquery/jquery.min.js"></script> //Given with my bootstrap theme
<script src="../vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
我调用的函数是这个:
function afficherPopupErreur() {
$('body').append('<div id="dialog" title="Basic dialog"><p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the x icon.</p></div>');
$( "#dialog" ).dialog();
}
我知道这个附加很奇怪,但它只是为了尝试对话。