Solved

JQuery -  object doesn't support property or method cookie

Posted on 2012-03-29
4
4,362 Views
Last Modified: 2012-08-14
Use JQuery tabs, and store the selected tab to the cookie, but it returns error saying that "
 Object doesn't support property or method 'cookie'

Use the following js files

<script src="/javascripts/jquery-latest.pack.js" type="text/javascript"></script>
<script type="text/javascript" src="/javascripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/javascripts/jquery-ui-1.8.18.custom.min.js"></script>

Below is my scripts

<script type="text/javascript">
$(function(){

      $('.selector').tabs({cookie: { expires:30 }});

      // Tabs
      $('#tabs').tabs();
      //hover states on the static widgets

      $(document).ready(function() {
         $('#tabs').tabs('select', $.cookie("tabNumber"));
         $('#tabs').click(function() {
           $.cookie("tabNumber", $("tabs").tabs('option', 'selected'));
         });
      });

      $('#dialog_link, ul#icons li').hover(
            function() { $(this).addClass('ui-state-hover'); },
            function() { $(this).removeClass('ui-state-hover'); }
      );

      $('#tabs').tabs({
          load: function(event, ui) {
              $(ui.panel).delegate('a', 'click', function(event) {
                  $(ui.panel).load(this.href);
                  event.preventDefault();
              });
          },
      });

});
</script>

===================================================
Do a google search for solution for a hour, still can't resolve this issue. can anyone here help me?
0
Comment
Question by:unistudent
4 Comments
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 37780793
It seem you did not include jquery coockie plug-in

Download and include it in your script

like

<script src="/javascripts/jquery.cookie.js"></script>

https://github.com/carhartl/jquery-cookie
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 37780801
you need to include jquery cookie plug-in
https://github.com/carhartl/jquery-cookie
0
 
LVL 82

Expert Comment

by:leakim971
ID: 37781545
And remove this line :
<script src="/javascripts/jquery-latest.pack.js" type="text/javascript"></script>

Open in new window

OR this one :
<script type="text/javascript" src="/javascripts/jquery-1.7.1.min.js"></script>

Open in new window


currently you've two jQuery plugins in your page
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Trying to redirect after event in javascript 3 24
where is team.js? 3 26
tiny glitch in my main slider 3 24
key press alert 2 19
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question