Download the X Distribution File.
see 'methods' below
Default.
// xCookie r2, Copyright 2009 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
var xCookie = {
get: function(name) {
var c = document.cookie.match(new RegExp('(^|;)\\s*' + name + '=([^;\\s]*)'));
return ((c && c.length >= 3) ? unescape(c[2]) : null);
},
set: function(name, value, days, path, domain, secure) {
if (days) {
var d = new Date();
d.setTime(d.getTime() + (days * 8.64e7)); // now + days in milliseconds
}
document.cookie = name + '=' + escape(value) +
(days ? ('; expires=' + d.toGMTString()) : '') +
'; path=' + (path || '/') +
(domain ? ('; domain=' + domain) : '') +
(secure ? '; secure' : '');
},
del: function(name, path, domain) {
this.set(name, '', -1, path, domain); // sets expiry to now - 1 day
}
};
toys - Index of all X demos.
6May09viewtopic.php?id=504: Forum topic.
By your use of X and/or CBE and/or any Javascript from this site you consent to the GNU LGPL - please read it. If you have any questions about the license, read the FAQ and/or come to the forums.
Forum support is available at the X Library Support Forums.
Cross-Browser.com is the home of X - a cross-browser Javascript library, and many demos, applications, articles and documentation.
If you are using X, XC or anything from this site, show off your work by posting a link in the X Showcase forum.