/[webpac]/trunk2/out/js/cookies.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/out/js/cookies.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 553 by dpavlin, Mon Oct 18 12:21:07 2004 UTC revision 554 by dpavlin, Fri Oct 29 22:05:51 2004 UTC
# Line 1  Line 1 
1  function get_cookie(name) {  function get_cookie(name) {
2            var no_val = '';
3            // uncomment following line to get old behaviour null on no cookie
4            //no_val = null;
5    
6          var start = document.cookie.indexOf(name+"=");          var start = document.cookie.indexOf(name+"=");
7          var len = start+name.length+1;          var len = start+name.length+1;
8          if ((!start) && (name != document.cookie.substring(0,name.length))) return null;          if ((!start) && (name != document.cookie.substring(0,name.length))) return no_val;
9          if (start == -1) return null;          if (start == -1) return no_val;
10          var end = document.cookie.indexOf(";",len);          var end = document.cookie.indexOf(";",len);
11          if (end == -1) end = document.cookie.length;          if (end == -1) end = document.cookie.length;
12          return unescape(document.cookie.substring(len,end));          return unescape(document.cookie.substring(len,end));

Legend:
Removed from v.553  
changed lines
  Added in v.554

  ViewVC Help
Powered by ViewVC 1.1.26