If built-in functions are the ones JavaScript defines by default,
user-defined functions are functions made by the user, for the user.
When programming, they're often used to optimize for your own environment
and to implement a different style from everyone else's.
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko"> |
|
|
|
|
|
<head> |
|
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
|
|
<title> user-defined function. </title> |
|
|
|
|
|
<script type="text/javascript"> |
|
|
//<!CDATA[ |
|
|
// Definition structure -> function functionName(){} |
|
|
function call(){ //function definition |
|
|
document.write("javascript study"); |
|
|
alert("good time "); |
|
|
} |
|
|
//]]]]]]> |
|
|
</script> |
|
|
|
|
|
</head> |
|
|
|
|
|
|
|
|
<body> |
|
|
<script type="text/javascript">call();</script> <!-- function call 1 --> |
|
|
<br /> |
|
|
<p>A defined function can be called repeatedly.</p> |
|
|
<br /> |
|
|
<script type="text/javascript">call();</script> <!-- function call 2--> |
|
|
|
|
|
</body> |
|
|
|
|
|
</html> |
