<html>
<body>
<script language="JavaScript">
<!--
var cookies = document.cookie;
function readCookie(name) {
var start = cookies.indexOf(name + "=");
if (start == -1){
alert("Cookie not found");
}
start = cookies.indexOf("=", start) + 1;
var end = cookies.indexOf(";", start);
if (end == -1){
end = cookies.length;
}
var value = unescape(cookies.substring(start, end));
if(value == null){
alert("No cookie found");
} else{
alert("Cookie value is: " + value);
}
}
readCookie("java2s.com");
-->
</script>
</body>
</html>
|