| example: |
var myData = new jt_.Cookie(document, "testPrefs", 24);
myData.load();
function bumpSave() {
idx++;
myData.position = idx;
myData.foobar = 'hello_' + idx;
myData.splat = 'sqr_' + (idx * idx);
myData.what = idx * 3;
myData.store();
jt_.Trace.msg("myData=" + jt_.TraceObj.str(myData));
jt_.Trace.msg("document.cookie=" + document.cookie);
}
|
| description: |
jt_.Cookie is based largely on code originally from Netscape. The constructor returns a simple JavaScript object which consists of arbitrary name/value pairs.
67 lines of code, 2.13 KB |
| main methods: |
jt_.Cookie = function(document, name, hours, path, domain, secure) jt_.Cookie.prototype.store = function() jt_.Cookie.prototype.load = function() jt_.Cookie.prototype.setAsObj = function(obj) jt_.Cookie.prototype.getAsObj = function() jt_.Cookie.prototype.remove = function() |