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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What we need for executing <script type="text/javascript" src... 1

Status
Not open for further replies.

stranger123

Programmer
Apr 16, 2006
76
GB
Hi,

Many javascripts not work after move to a new server, they all have the format
<script type="text/javascript" src="xxxx.xxx"></script>

1. They were working fine in the old server.
2. They are working fine at the moment in my IIS.
3. If change to format
<SCRIPT language='javascript'>
<!--
//the code in xxxx.xxx
//-->
</SCRIPT>
they will work OK in the new server.

Do you have any idea?
 
Check the paths in the xxxxx.xxx part. They should link to the javascript. I'm guessing that you have some invalid paths specified. Also be aware that some operating systems are case sensitive for file names (myfile.js is not the same as myFILE.JS - for instance).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Thanks a lot for your help.

I have just try following very simple code that not works in the new server. both try1.html and try1.jav in the same folder and no capital at all in the file names and in the code:

try1.html
---------
<html>
<head>
<script type="text/javascript" src="try1.jav"></script>
</head>
<body>
<a href="javascript: try1();">go</a>
</body>
</html>

try1.jav
--------
function try1()
{
alert("1111111");
}
 
My God!!! Why???? You are right!!!
So, you think the new server only recognises .js in
<script type="text/javascript" src="xxxx.xxx"></script>
 
Perhaps you need to configure your web server to serve ".jav" files as a different MIME type... but to be honest, it's easier to simply go with a .js extension - most people immeditately recognise this as a JavaScript file, whereas a .jav file would probably me thought of as a Java file.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top