javascript - Setting a cookie that triggers a redirect -
javascript - Setting a cookie that triggers a redirect -
<!doctype html> <html> <head> <title>login test</title> <script> window.onload = iniall; function iniall(){ document.getelementbyid("client").onclick = setcookie; var setcookie = function(exdays){ var d = new date(); d.setime(d.gettime() + (exdays *20*60*60*1000)); var expires = "expires="+d.toutcstring(); documenet.cookie = test = "=" + test + "; " loadpagec(); } var loadpagec = function(){ window.location = "http://www.cnn.com"; homecoming false; } if (document.cookie === "test = test"){ homecoming loadpagec; } else { } } </script> </head> <body> <span style="text-align: center;"><h1>make choice.</h1></span> <a href="http://www.threepanelsoul.com" id="client">client</a> </body> </html>
here updated code still neither cookie setting nor redirect called function loadpagec. komodo telling me iniall not homecoming value. want check cookie either called reader/client or value of reader/client, , depending of if reader redirect reader page , client cookie client page. scirpt needed have else function of loading login page in absence of cookie, have striped out in effor cookie redirect work.
javascript html
Comments
Post a Comment