ftdeveloper
ftdeveloper

Reputation: 1093

window.jQuery.ui is undefined

Hi in my website i loaded all jquery javascripts and css but i write console.log(window.jQuery.ui); it returns undefined. I dont know why.

So if i write $(".tooltip").tooltip(); It says:TypeError: Object [object Object] has no method 'tooltip'

My code is shown below:

<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> 

Upvotes: 0

Views: 4267

Answers (1)

Khior
Khior

Reputation: 1254

The console will always return undefined because jQuery UI extends the jquery object itself, it doesn't get added as a property of the jQuery object. That is why you can do this:

$('a.button').button();

instead of:

$('a.button').ui.button();

Also, you will need to swap the following lines around like so to make sure you don't get any jQuery UI errors:

<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> 

Upvotes: 2

Related Questions