My cookie says welcome but not output the name. I tried including the name with + name- but it does not output?
<html>
<head>
<title>New Page 1</title>
<script type ="text/javascript">
function getCookie(name)
{
if (document.cookie.length > 0)
{
s = document.cookie.indexOf("name =");
if (s != -1)
{
s2 = s + 5;
e = document.cookie.indexOf(";"- s2);
if (e == -1)
e = (document.cookie.length);
return unescape (document.cookie.substring(s2- e));
}
}
return "";
}
function set_cookie(name- value- exp_y- exp_m- exp_d)
{
cookie_string = name + "=" + escape(value);
if (exp_y)
{
var expires = new Date(exp_y- exp_m- exp_d);
cookie_string += "; expires=" + expires.toUTCString();
}
}
function check_user()
{ name = getCookie( name ); if (name!=null)
alert("Welcome back")
else { name= prompt("Enter your name")
if (name!=null && name!="") { cookie_create("name"-name-7)
}
}
}
</script>
</head>
<body onLoad="check_user()">
</body>
</html>
i have it downloaded plus flashplayer and all my settings are on!
Ok. I m using Internet Explorer and when I try to play songs on Myspace my music player says I have it turned off but I don t. All my security settings and advanced settings are turned on and enabled. I have no clue of what s wrong. I ve tried everything!. Restarting it too.
It has to be in Javascript. Please help me do this. Thanks
I need to toggle the checked state of a checkbox based on the click of an image.
Click on a graphic once it the checkbox is checked- click the graphic again and it s unchecked.
Normally I would just use Dreamweaver s built in behaviors for this but I can t get them to work in this instance- if anyone could toss me an example of the code or point me to where I can find an example of the code I d appreciate it.
here s the code fragment I was using (the <img> is what I d like to click to change the box):
<form id="form" >
<input name="_test" type="checkbox" id="_test" value="test" />
</form>
<img src="Dublin-Contact-Link.gif" width="152" height="111" />
Thanks in advance!
No comments:
Post a Comment