PDA

View Full Version : Tab Content Path Issue



shoppersusa.com
12-19-2006, 09:52 AM
1) Script Title: Tab Content Script

2) Script URL (on DD): [url]http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm/url]

3) Describe problem:When using persist cookies with multiple pages using the tab content script with different layers and tabs on different files on the same domain, if you have different numbers of tabs on different page and you are using sitewide path, it will cause problems when the visited page does not have enough number of the layer that you just visited. the path has to be set to the specific path instead of using sitewide path.

Here is the code fix to a function listed in the js file

change the original setCookie(name,value) block to the following


function setCookie(name, value){
var pathname = window.location.pathname;
var cookie_string = name+"="+value;
if (pathname != null)
cookie_string += "; path=" + pathname;
document.cookie = cookie_string;
}

shoppersusa.com
02-19-2007, 03:16 AM
function setCookie(name, value){
var pathname = window.location.pathname;
var cookie_string = name+"="+value;
if (pathname != null)
cookie_string += "; path=" + pathname;
document.cookie = cookie_string;
}

SHALL BE CHANGED TO


function setCookie(name, value){
var pathname = window.location;
var cookie_string = name+"="+value;
if (!pathname)
cookie_string += "; path=" + pathname;
document.cookie = cookie_string;
}

if looks like window.location.pathfilename is not working with IE 7