[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

JQuery -  object doesn't support property or method cookie

Posted on 2012-03-29
4
Medium Priority
?
5,307 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
3 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:
Gurvinder Pal Singh earned 2000 total points
ID: 37780801
you need to include jquery cookie plug-in
https://github.com/carhartl/jquery-cookie
0
 
LVL 83

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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…
Suggested Courses

834 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