You are here: irt.org | FAQ | JavaScript | Source | Q1738 [ previous next ]
It is necessary to define the function before invoking it. Therefore it is best to reorder the inclusion of the *.js files in your page. For example:
<html> <head> <script language="JavaScript" src="test1.js"></script> <script language="JavaScript" src="test2.js"></script> </head> <body> ... </body> </html>
where test1.js contains:
function functionName() { alert('Hello world'); }
and test2.js contains:
functionName();