m...@mtekusa.com wrote:
One thing I am unclear on is this....Say I have the following in one
page:
<SCRIPT>
function {
.
.
.
}
some code which calls the above function
</SCRIPT>
Then, I have this in the other page:
<SCRIPT>
function {
.
.
.
}
some differnet code which calls the above function
</SCRIPT>
Since the function is reusable, how do I include it between the
<SCRIPT... </SCRIPTheaders??
The reusable function needs to be placed in a separate file. Say 3
files in a same directory:
remote.js:
function showMessage(m) {
alert(m);
}
call from one.htm:
<script type="text/javascript" src="remote.js"></script>
<script type="text/javascript">
showMessage('Hello');
</script>
call from two.htm:
<script type="text/javascript" src="remote.js"></script>
<script type="text/javascript">
showMessage('Hello again');
</script>
Cheers,
--
Bart