[TYPO3-dev] Problem with JS handling

Tapio Markula tapio.markula at xetpoint.fi
Wed Jul 16 12:28:21 CEST 2008


Hi

I tested a possible menu system in a plugin, which use with JS cookies.
This hanged in IE 6 - not real IE 6 but multiple IE

	function ReadCookie(cookieName) {
		var theCookie=""+document.cookie;
		var ind=theCookie.indexOf(cookieName);
		if (ind==-1 || cookieName=="") return "";
		var ind1=theCookie.indexOf(";",ind);
		if (ind1==-1) ind1=theCookie.length;
		return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
	}	
	...
	function saveLevel2(value) {
	...
		
		var name2 = "level2PrevItem";
		date.setTime(date.getTime()+(24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		document.cookie = name2+"="+value+expires+"; path=/";
	}
	...
	function closePrevLevel2(value) {
		var previousItem = ReadCookie("level2PrevItem");
		if(value!=previousItem) {
			tx_dropdownsitemap_pi1_swapClassesClose(previousItem);
		}
	}	

I tested the last function with a fixed value - worked - so the problem 
relates with cookie handling. I just doesn't understand why this doesn't 
worked in multiple IE.




More information about the TYPO3-dev mailing list