chaseinchrist
05-31-2006, 10:29 PM
I hope that I don't annoy some people by posting this here, it's pretty basic, but I am learning Javascript from a website, and I have just gotten finished reading about Javascript Functions, and this is a pretty cool website that gives you assignments to do, and this particular assignment tells me to write a function that will add two numbers together at any place on the page.
This is what I typed:
<html>
<head>
<script language="javascript"><!--
function myAdder(){
var total= 23+56
document.write(total) }
//--></script>
</head>
<body>
<SCRIPT language="JavaScript">
<!--
document.write(myAdder(23,56))
//-->
</SCRIPT>
</body>
</html>
when I go to look at the result, I get 79undefined. What is undefined? I have tried alot with this script, so know that I don't come here as soon as I fail at something......Can somebody please find it deep deep deep down in their big heart to help me with this? Thanks in advanced
-Chaseinchrist
This is what I typed:
<html>
<head>
<script language="javascript"><!--
function myAdder(){
var total= 23+56
document.write(total) }
//--></script>
</head>
<body>
<SCRIPT language="JavaScript">
<!--
document.write(myAdder(23,56))
//-->
</SCRIPT>
</body>
</html>
when I go to look at the result, I get 79undefined. What is undefined? I have tried alot with this script, so know that I don't come here as soon as I fail at something......Can somebody please find it deep deep deep down in their big heart to help me with this? Thanks in advanced
-Chaseinchrist