0

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> 
2
  • 1
    Because $(".tooltip").tooltip() not working. Commented Nov 26, 2013 at 10:44
  • yep i see now. you can follow as @khior answered. Commented Nov 26, 2013 at 10:46

1 Answer 1

2

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> 
Sign up to request clarification or add additional context in comments.

4 Comments

I did what you say. When i write console $(".tooltip").tooltip(); It says:TypeError: Cannot call method 'tooltip' of undefined
Your block of script tags should now look like my edited answer, is this the case?
Did not work for me. Getting same error:TypeError: Object [object Object] has no method 'tooltip'
Can you replicate this in a jsfiddle?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.