helpchrisplz
asked on
jquery question cookie
hi all
i currently have this jquery tab set up http://jqueryui.com/demos/tabs/
but i would like to set a cookie to save the link last used for when the page reloads.
i have taken a look at this http://jqueryui.com/demos/tabs/#cookie
but cant find a example of code for setting the cookie.
how do i set this cookie ?
i currently have this jquery tab set up http://jqueryui.com/demos/tabs/
but i would like to set a cookie to save the link last used for when the page reloads.
i have taken a look at this http://jqueryui.com/demos/tabs/#cookie
but cant find a example of code for setting the cookie.
how do i set this cookie ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok so i have this but its not saving the tab on page reload. ?
<script type="text/javascript" src="js/jquery-1.5.1.min.j s"></scrip t>
<script type="text/javascript" src="js/jquery-ui-1.8.11.c ustom.min. js"></scri pt>
<script type="text/javascript" src="js/jquery.cookie.js"> </script>
<script>
$(function() {
$( "#tabs" ).tabs({
cookie: {
// store cookie for a day, without, it would be a session cookie
expires: 1
}
});
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Appointment options</a></li>
<li><a href="#tabs-2">Add or remove patient</a></li>
<li><a href="#tabs-3">Practitione r options</a></li>
<li><a href="#tabs-4">Treatment options</a></li>
</ul>
<div id="tabs-1">Appointment options</div>
<div id="tabs-2">Add or remove patient</div>
<div id="tabs-3">Practitioner options</div>
<div id="tabs-4">Treatment options</div>
</div>
</div>
<script type="text/javascript" src="js/jquery-1.5.1.min.j
<script type="text/javascript" src="js/jquery-ui-1.8.11.c
<script type="text/javascript" src="js/jquery.cookie.js">
<script>
$(function() {
$( "#tabs" ).tabs({
cookie: {
// store cookie for a day, without, it would be a session cookie
expires: 1
}
});
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Appointment
<li><a href="#tabs-2">Add or remove patient</a></li>
<li><a href="#tabs-3">Practitione
<li><a href="#tabs-4">Treatment options</a></li>
</ul>
<div id="tabs-1">Appointment options</div>
<div id="tabs-2">Add or remove patient</div>
<div id="tabs-3">Practitioner options</div>
<div id="tabs-4">Treatment options</div>
</div>
</div>
ASKER
ok it seems to be working now :)
It shows both a conventional way and the jQuery way. HTH.