First page Back Continue Last page Image

<!DOCTYPE html>

<html>

<head>

<title>I know your name!</title>

<script src="script02.js"></script>

</head>

<body>

<h1 id="nameField">&nbsp;</h1>

</body>

</html>

window.addEventListener("load",nameFieldInit,false);

function nameFieldInit() {

if (document.cookie != "") {

document.getElementById("nameField").innerHTML = "Hello, " + document.cookie.split("=")[1];

}

}

Change the contents of the object named “namefield”

First add the text string “Hello “

Then split the cookie on the “=” and concatenate the 2nd item in the cookie to this string

You Have to Run Script 1 first before this script or it will not work