OLD | NEW |
| (Empty) |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o
rg/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
2 | |
3 <html xmlns="http://www.w3.org/1999/xhtml"> | |
4 <head> | |
5 <title>Session cookie destination</title> | |
6 <script type="text/javascript"> | |
7 //Get cookie routine by Shelley Powers | |
8 function get_cookie(Name) { | |
9 var search = Name + "="; | |
10 var returnvalue = ""; | |
11 if (document.cookie.length > 0) { | |
12 offset = document.cookie.indexOf(search); | |
13 // if cookie exists | |
14 if (offset != -1) { | |
15 offset += search.length; | |
16 // set index of beginning of value | |
17 end = document.cookie.indexOf(";", offset); | |
18 // set index of end of cookie value | |
19 if (end == -1) end = document.cookie.length; | |
20 returnvalue=unescape(document.cookie.substring(offset, end)) | |
21 } | |
22 } | |
23 return returnvalue; | |
24 } | |
25 | |
26 function setcolor(){ | |
27 document.body.style.backgroundColor=get_cookie("bgcolor") | |
28 } | |
29 </script> | |
30 </head> | |
31 <body onload="setcolor()"> | |
32 This is the cookie destination page. | |
33 </body> | |
34 </html> | |
OLD | NEW |