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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -