Issue with Tabs/Cookie
Issue with Tabs/Cookie
Hi all,
I have a longstanding, working tabs implementation that I'm improving
via cookie support, amongst other things. The program flow is
essentially:
Button triggers AJAX load into modal window, on ajaxComplete,
initialise tabs.
Button triggers AJAX load into modal window.
User performs data manipulation.
Form is submitted via AJAX, response is loaded into modal window, on
ajaxComplete, tabs are initialised.
The initialisation code is:
// Enable tabs for the content panels.
$("#alertWindow .jqmAlertContent").tabs({
cookie: {
expires: 1,
name: 'userTabs'
}
});
Whilst I can see that the correct cookie is being created, with the
correct Content value, expiration, path and name, the plugin seems to
completely ignore it the next time it's invoked, and just creates a
new cookie with the exact same details.
The site is running on my localhost, and as explained, the
window.location does not change at any point, nor are iFrames used for
anything. Some quick testing has revealed that if you load the modal
window, click a tab, close the modal, navigate to another page and
open the modal from there, it does indeed utilise the cookie value and
select the tab correctly. Is there a reason the cookie value does not
go straight into memory?
I'm using jQuery 1.3.2, jQuery ui 1.7.2, and the Cookie plugin.