Solved

JQuery -  object doesn't support property or method cookie

Posted on 2012-03-29
4
4,252 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now