Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript not working in internet Explorer????

Status
Not open for further replies.

jeevan

Programmer
Apr 11, 2001
9
IN
hi all,
The problem is that javascript is not working when it was written as follows

<Script language=&quot;javascript&quot; src=&quot;crescendo.js&quot;>
</script>

crscendo.js seperate textfile in the same directory.But it is working when the script directly given in the same page
like this

<script laguage=&quot;javascript&quot;>
<!--
java script statemets
-->
</script>

what will be the problem .please reply-----
 
Der jeevan,

Without seeing your code this is just a guess. Try putting the code that is in crescendo.js inside a function like this:

// file crescendo.js
function doCrescendo(){

// existing code
}

Now in your page do this:
<Script language=&quot;javascript&quot; src=&quot;crescendo.js&quot;>
</script>

<body>
..... blah blah bunch of HTML etc.
</body>
</html>

<script language=&quot;javascript&quot;>
<!--
doCrescendo();
-->
</script>

Hope this helps
-pete
 
one thing i have done is to include my javascript include file like this:
<!--#include file=&quot;filename&quot;-->
<HTML>
<BODY>
etc.....

also, make sure the include file has beginning and ending script tags in it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top