January 2001
Beginner
312 pages
6h 4m
English
Now let's talk about those parentheses at the end of the function name—they've got to be there for some reason, right?
These parentheses are actually used to hold a parameter. Parameters act just like variables and can hold just about any data you want—text strings, numbers, Boolean values, and so on.
Let's look at an example of a function that uses parameters:
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
function yourMessage(quote)
{
alert(quote);
}
// Cloaking device off -->
</script>
</head>
<body>
<p>Click <input type="button" value="HERE" onClick="yourMessage('How come dumb stuff seems
so smart while you\ 're doing it!')"> for a message!</p> <br> <p>Click ...Read now
Unlock full access