You can set the active tab using the active option, for example
$( ".selector" ).tabs({ active: 1 });
There are many ways to pass values ββto a web page other than cookies. For example, you can use query parameters and hidden fields. Then you will create an onload script that will read any example using the jQuery download example. $ (function () {}).
To read the query strings, check out this page, which gives you a method
jquery read query string
function getParameterByName( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return decodeURIComponent(results[1].replace(/\+/g, " ")); }
and read the hidden field.
$( ".selector" ).tabs({ active: $('#my-hidden-fiel').val() });
I agree with jquery ui's decision to remove this function, since cookies should really only be used to save sessions in my opinion, and not to create fields or tabs, for example.
RyanFishman Jan 14 '13 at 4:22 2013-01-14 04:22
source share