Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » What's wrong with this JS?
Closed Thread
Old 04-23-2006, 04:06 PM   #1 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 39

smartydebater

Default What's wrong with this JS?

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Validation</title>
<script language="text/javascript">
function Validation()
{
function ReadCookie()
{
	with (document.CookieReader)
		{ if (document.cookie.banner == "1")
			{alert ("1") }
		if (document.cookie.banner == "2")
		   {alert ("2") }
		}
}
ReadCookie();
}
</script>
		

</head>

<body>
<input type="button" value="Click Me!"onClick="Validation()">
</body>
</html>
The visitor will either have a cookie named banner with a value of 1 or 2.

This script will read the cookie and tell you whether it's value is 1 or 2. I think the problem is that the it's not reading the cookie's value. Anybody have any ideas?
smartydebater is offline  
Old 04-23-2006, 05:09 PM   #2 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

Don't double post, please... thread locked.
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On