1 2jQuery.cookie = function(name, value, options) { 3 if (typeof value != 'undefined') { // name and value given, set cookie 4 options = options || {}; 5 if (value === null) { 6 value = ''; 7 options.expires = -1; 8 } 9 var expires = ''; 10 if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 11 var date; 12 if (typeof options.expires == 'number') { 13 date = new Date(); 14 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 15 } else { 16 date = options.expires; 17 } 18 expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 19 } 20 var path = options.path ? '; path=' + options.path : ''; 21 var domain = options.domain ? '; domain=' + options.domain : ''; 22 var secure = options.secure ? '; secure' : ''; 23 document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 24 } else { // only name given, get cookie 25 var cookieValue = null; 26 if (document.cookie && document.cookie != '') { 27 var cookies = document.cookie.split(';'); 28 for (var i = 0; i < cookies.length; i++) { 29 var cookie = jQuery.trim(cookies[i]); 30 // Does this cookie string begin with the name we want? 31 if (cookie.substring(0, name.length + 1) == (name + '=')) { 32 cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 33 break; 34 } 35 } 36 } 37 return cookieValue; 38 } 39};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.