Hi,

I am using JQuery UI tabs along with cookie plugin to remember tabs.
The code on the home page works absolutely fine. When a tab is
switched, it remembers the switched tab upon refresh. When the "Home"
button is clicked, it switches to the first tab. When "Logout" link is
clicked, it deletes the cookie and redirects to a login page.  Upon
visiting the "Home" page, it switches to the first tab again. All is
well so far.. Following is the code on the Home page:
===========================================================
<script src="/jquery-ui/js/jquery-1.2.3.min.js" type="text/
javascript"></script>
<script src="/jquery-ui/js/ui.core.min.js" type="text/javascript"></
script>
<script src="/jquery-ui/js/ui.tabs.min.js" type="text/javascript"></
script>
<script src="/jquery-ui/js/jquery.cookie.js" type="text/javascript"></
script>
<script type="text/javascript">
    $(function() {

        $('#container ul').tabs({cookie: { expires: 0 }});

        $('#container > ul').bind('tabsselect', function(event, ui) {
                $('#container > div > ul').tabs('select', 0);
        });

        $('#navgohome').click(function() {
             $('#container ul').tabs('url', 2, this.href).tabs
('select', 0);
        });

        $("#logout").click(function () {
            $.cookie('ui-tabs11', '', { expires: -1 });
         });
    });
</script>
============================================================

When I navigate to a different page in the same website, and click the
same "logout" or "home" link, it doesn't delete the cookie and doesn't
work as it's working on the home page. It can read the cookie value
properly, but just doesn't delete it. What am I missing?

=== Code on other page ==========
<script src="/jquery-ui/js/jquery-1.2.3.min.js" type="text/
javascript"></script>
<script src="/jquery-ui/js/ui.core.min.js" type="text/javascript"></
script>
<script src="/jquery-ui/js/ui.tabs.min.js" type="text/javascript"></
script>
<script src="/jquery-ui/js/jquery.cookie.js" type="text/javascript"></
script>
<script type="text/javascript">
    $(function() {

        $('#navgohome').click(function() {
            $.cookie('ui-tabs11', '', { expires: -1 });
        });

        $("#logout").click(function () {
            $.cookie('ui-tabs11', '', { expires: -1 });
         });
    });
</script>

Please help !!

--

You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to jquery...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-ui+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.


Reply via email to