hi guys! I just started learning javascript 5 minutes ago! Now, take a look at this code:
[code=php]
<html>
<head>
<meta name=”GENERATOR” content=”Microsoft FrontPage 5.0″>
<meta name=”ProgId” content=”FrontPage.Editor.Document”>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<title>New Page 1</title>
<script language=”javascript”>
var message=”hello this is a test of memory”
window.alert(message)
</script>
<script language=”javascript”>
var test=”You should have clicked a link to be able to read this message”
window.alert(test)
</script>
</head>
<body onload=’message’>
<a href=’javascript:window.alert(test);’>klsgdhslhfh<a>
</body>
</html>
I wanted to make a message box come up when the body loads, it works, but i wanted to create a link that when clicked, produces another alert.
I already know the code for it, but i want you to show me what is wrong here. I want it to be in the same style (arrays). I want you to tell me also why it comes up when the body loads!
Thanx guys