If the file is just a javascript file you have to save it with a .js file extension and then call it from an HTML page as JavaScript does not run on its own. It must be part of a webpage.
stymiee
He's No Good To Me Dead
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
another think to keep in mind, if you take that script from somebody site it may not work properly/ at all because it need some data
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
and to include js file in your pages
<script language="JavaScript" src="javascript.js" type="text/javascript">
</script>
vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
You can run the javascript by including within your html file or just include the External Javascript file within the html file.
<html>
<head>
<!-- Internal Javascript Function -->
<script language="javaScript">
//Write your javascript functions within this script tag
</script>
<!-- External Javascript Function -->
<script language="JavaScript" src="javascript.js" type="text/javascript"/>
</head>
<body>
</body>
</html>
rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239