Calling JavaScript Functions


Calling JavaScript Functions
To execute a function, we simply call upon the name of the function followed by an opening parenthesis, arguments (if any) and on the lid with a closing parenthesis.
Function_Name();

Note:
  • The semicolon to inform the navigator of the end of a different block of instruction.
  • If you define an argument to a function, then calling when you should call these functions complete with the argument.

Please note to always declare a function before you call, because the navigator is always read HTML and script from top to bottom, therefore, in general functions inside the SCRIPT tags are placed at the head of an HTML document (between the tags <HEAD> and </ HEAD >

Administrator event named onLoad (placed in the BODY tag), we can call the function when loading the HTML document page, as an example of the initialization value or the beginning of your script to test whether the navigator can perform the function of the script or not. Examples are as follows:
<HTML>
<HEAD>
<script Language="JavaScript">
<! -
function Calling() {
instruction block
}
//-->

</ SCRIPT>
</ HEAD>
<body OnLoad="Calling();">
... ... ... ... ... ... ... ... ... ... ... ... ...
</ BODY>
</ HTML>
Calling JavaScript Functions

0 comments:

Post a Comment