thall411
02-21-2006, 05:20 PM
This is an example of an html page I am trying to create.
When it is run "as is" (with the function subCall in a .js file in the same directory as the .html file, only the first alert shows. But, comment that line out and uncomment the function definition, it works file.
Of course, this works locally, but when I put it onto the server, it doesn't.
I'm new to scripting so I'm hoping there is an easy fix to this.
BTW - this is on http://www.teresahall411.com/example.html
Thanks - Teresa
<HTML>
<HEAD>
<script language='JavaScript' type='text/JavaScript' src='example.js'></script>
<SCRIPT language="javascript">
<!-- function subCall(){ alert('in subCall') ; } -->
function init() {
alert('in init') ;
subCall() ;
alert('after call') ;
}
</SCRIPT>
</HEAD>
<BODY ONLOAD='init()'>
<FORM NAME='frmChooseDrivers'>
<TABLE ID='commentTbl'></TABLE>
</FORM> </BODY>
</HTML>
Here is the example.js file:
function subCall() {
alert('in subCall') ;
}
When it is run "as is" (with the function subCall in a .js file in the same directory as the .html file, only the first alert shows. But, comment that line out and uncomment the function definition, it works file.
Of course, this works locally, but when I put it onto the server, it doesn't.
I'm new to scripting so I'm hoping there is an easy fix to this.
BTW - this is on http://www.teresahall411.com/example.html
Thanks - Teresa
<HTML>
<HEAD>
<script language='JavaScript' type='text/JavaScript' src='example.js'></script>
<SCRIPT language="javascript">
<!-- function subCall(){ alert('in subCall') ; } -->
function init() {
alert('in init') ;
subCall() ;
alert('after call') ;
}
</SCRIPT>
</HEAD>
<BODY ONLOAD='init()'>
<FORM NAME='frmChooseDrivers'>
<TABLE ID='commentTbl'></TABLE>
</FORM> </BODY>
</HTML>
Here is the example.js file:
function subCall() {
alert('in subCall') ;
}