Results 1 to 2 of 2

Thread: Tab Content Path Issue

  1. #1
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tab Content Path Issue

    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
    Code:
    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;	
    }
    Last edited by shoppersusa.com; 12-19-2006 at 11:56 PM.

  2. #2
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by shoppersusa.com; 02-19-2007 at 04:17 AM. Reason: Syntax Error

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •