sessionCookie.html 761 B

123456789101112131415161718192021
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title></title>
  5. <script type="text/javascript">
  6. function setcolor(what){
  7. document.body.style.backgroundColor=what
  8. document.cookie="bgcolor="+what
  9. }
  10. function popuponclick() {
  11. my_window = window.open("sessionCookieDest.html", "cookiedestwindow", "status=1,width=350,height=150");
  12. }
  13. </script>
  14. </head>
  15. <body>
  16. <input id="setcolorbutton" type="button" value="Set Background Color" onclick="setcolor('#80FFFF')"/>
  17. <input id="openwindowbutton" type="button" value="Open New Window" onclick="popuponclick()"/>
  18. </body>
  19. </html>