Forum Moderators: open
if(document.cookie.match("mysettings"))
Is this method efficient when the website has more than 100 pages and guest has to do this checking on every page?
I once wonder if the checking speed will be seriously slow down when guest's computer has stored a lot of cookies, but because this method checks the cookie that was set at the same domain, so it is the fastest method. Right?
[edited by: Ian2k8 at 6:05 am (utc) on Mar. 29, 2008]
- John
var $theme = getCookie("theme"); function getCookie(Name) { var search = Name + "="; var CookieString = document.cookie; var result = null;
if (CookieString.length > 0) { offset = CookieString.indexOf(search); if (offset != -1) { offset += search.length; end = CookieString.indexOf(";", offset)
if (end == -1) {end = CookieString.length}; result = unescape(CookieString.substring(offset, end))}}return result;}