The Java code in the Web page needs to be written in JavaScript, with some of the functions in it, describing the types of functions commonly used in JavaScript.
1. Variable function
<script>
function Show () {
alert ("First ...) ");
}
function Show (str) {
alert ("second");
}
Function Show (a,b) {
alert ("Third ... ");
Alert (A + ":" +b);
}
</script>
In a comprehensive example, the functions in JS are not overloaded. It must be all right. The function, while defined, declares a number of variables, but it can be passed into any of the calls. In each function, there is a default array arguments that stores all the arguments passed in at the time of this call.
2. anonymous function
3. Dynamic function
Introduction: using JS built-in object function to construct a function, the 1th parameter in the construction method is "formal parameter", the 2nd parameter is "function body".
<span style= "FONT-SIZE:18PX;" ><! DOCTYPE html>