window.jQuery.ui is undefined
window.jQuery.ui is undefined
嗨,在我的网站上,我加载了所有jquery-java脚本和css,但我写了console.log(window.jquery.ui);它返回undefined。我不知道为什么。
所以,如果我写$(".toolkit").tooltip();上面写着:TypeError:Object〔Object Object〕没有方法"工具提示"
我的代码如下所示:
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link href="css/epoch_styles.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.selectbox.css" rel="stylesheet" type="text/css" />
<link href="css/OnlineRezervasyon.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.ui.tooltip.min.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/jquery.tooltip.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script src="js/epoch_classes.js" type="text/javascript"></script>
<script src="js/jquery.validate.min.js" type="text/javascript"></script>
<script src="js/jquery.selectbox-0.2.js" type="text/javascript"></script>
<script src="js/script.js" type="text/javascript"></script>
控制台将始终返回undefined
,因为jQuery UI扩展了jQuery对象本身,它不会被添加为jQuery对象的属性。这就是为什么你可以这样做:
$('a.button').button();
而不是:
$('a.button').ui.button();
此外,您还需要像这样交换以下行,以确保不会出现任何jQuery UI错误:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script src="js/jquery.tooltip.js" type="text/javascript"></script>
<script src="js/epoch_classes.js" type="text/javascript"></script>
<script src="js/jquery.validate.min.js" type="text/javascript"></script>
<script src="js/jquery.selectbox-0.2.js" type="text/javascript"></script>
<script src="js/script.js" type="text/javascript"></script>
相关文章:
- Jquery - table.row(tr) is undefined
- noty.js is returning undefined
- $routeParams is undefined
- Angular js $scope is Undefined
- $scope is coming as undefined
- Angular - $cookies is undefined
- TypeError: e is undefined - javascript
- “google.maps.MapTypeId is undefined”在FF 14中使用GMAP3时
- chrome.storage.local["mykey"] is undefined
- 回调在 Angular2/Firebase 中生成“TypeError: this is undefined”
- KendoWindow .visible(); is undefined?
- jQuery .forEach() 导致错误,“undefined is not a function”
- 使用“flickrnode”API时出现“TypeError: undefined is not a function”
- "undefined is not a function" onSuccessHandler
- 莫名其妙的“Undefined is not a function”错误 — 由“getElementsById”引起
- Angular js 在传递 promise 时$asyncValidator“Undefined is not a f
- undefined is not a function when evaluating 'this.batman
- “uncatch TypeError: undefined is not a function” 在使用 str.ind
- 谷歌地图API(使用gmapsjs), setCenter抛出“undefined is not a function”
- 在骨干应用视图中出现" Uncaught TypeError: undefined is not a function