473,473 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Multiple JavaScript includes fail

Has anyone experienced this (and found a solution)?

I have five files: a .htm that invokes four .js include files.

Only the first alert in the first include is displayed.

This only happens when I run on a client's corporate server.

I have no problems on a laptop connected to the network
or on my home PC. Any ideas? Thanks in advance.
<html>
<head>
<title>test_js.htm</title>
</head>
<body>
<script type="text/javascript" src="test_js.js"></script>
<script type="text/javascript" src="test_js.js1"></script>
<script type="text/javascript" src="test_js.js2"></script>
<script type="text/javascript" src="test_js.js3"></script>
</body>
</html>

alert("test_js.js");

alert("test_js.js1");

alert("test_js.js2");

window.onload = function() {
alert("test_js.js3");
}

I moved the includes into the head;
I took out the last include;
it still fails on one server.

I'm stumped.

If I merge them into one include it works.
Nov 16 '06 #1
7 1929
"McKirahan" <Ne**@McKirahan.comwrote in news:DeudnXL4
_b**********************@comcast.com:
Has anyone experienced this (and found a solution)?

I have five files: a .htm that invokes four .js include files.

Only the first alert in the first include is displayed.

This only happens when I run on a client's corporate server.

I have no problems on a laptop connected to the network
or on my home PC. Any ideas? Thanks in advance.
<html>
<head>
<title>test_js.htm</title>
</head>
<body>
<script type="text/javascript" src="test_js.js"></script>
<script type="text/javascript" src="test_js.js1"></script>
<script type="text/javascript" src="test_js.js2"></script>
<script type="text/javascript" src="test_js.js3"></script>
</body>
</html>

alert("test_js.js");

alert("test_js.js1");

alert("test_js.js2");

window.onload = function() {
alert("test_js.js3");
}

I moved the includes into the head;
I took out the last include;
it still fails on one server.

I'm stumped.

If I merge them into one include it works.
Easy to try:
Create four html files on the server, each with only one js include.

<body>
<script type="text/javascript" src="test_js.js"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js1"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js2"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js3"></script>
</body>

Try each html file. Do they all work?

P.S. You can name your files any way you like, but wouldn't test_js1.js
be more logical than test_js.js1?
Nov 16 '06 #2
"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrote in message
news:Xn**********************************@216.168. 3.44...
"McKirahan" <Ne**@McKirahan.comwrote in news:DeudnXL4
_b**********************@comcast.com:
Has anyone experienced this (and found a solution)?

I have five files: a .htm that invokes four .js include files.

Only the first alert in the first include is displayed.

This only happens when I run on a client's corporate server.

I have no problems on a laptop connected to the network
or on my home PC. Any ideas? Thanks in advance.
<html>
<head>
<title>test_js.htm</title>
</head>
<body>
<script type="text/javascript" src="test_js.js"></script>
<script type="text/javascript" src="test_js.js1"></script>
<script type="text/javascript" src="test_js.js2"></script>
<script type="text/javascript" src="test_js.js3"></script>
</body>
</html>

alert("test_js.js");

alert("test_js.js1");

alert("test_js.js2");

window.onload = function() {
alert("test_js.js3");
}

I moved the includes into the head;
I took out the last include;
it still fails on one server.

I'm stumped.

If I merge them into one include it works.

Easy to try:
Create four html files on the server, each with only one js include.

<body>
<script type="text/javascript" src="test_js.js"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js1"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js2"></script>
</body>

<body>
<script type="text/javascript" src="test_js.js3"></script>
</body>

Try each html file. Do they all work?

P.S. You can name your files any way you like, but wouldn't test_js1.js
be more logical than test_js.js1?
Thanks for your reply but you didn't understand.

The example I included fails only on one server.

Each of the includes work -- all they do is show an alert.
Nov 16 '06 #3
"McKirahan" <Ne**@McKirahan.comwrote in news:uZ-
dn***************************@comcast.com:
The example I included fails only on one server.

Explain a little more, then. How many servers are there? Where do the JS
files reside, on only one server, or on all of the servers?
Nov 16 '06 #4
"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrote in message
news:Xn**********************************@216.168. 3.44...
"McKirahan" <Ne**@McKirahan.comwrote in news:uZ-
dn***************************@comcast.com:
The example I included fails only on one server.

Explain a little more, then. How many servers are there? Where do the JS
files reside, on only one server, or on all of the servers?
Thanks again for your interest.

I thought there was enough information in my first post...

The example I posted fails but only on one server.

Of course my example is a stripped down subset of a real
problem -- but it doesn't matter as the example fails!

Create the files, put them in a folder on a Web server,
then open the page via http://whatever/test_js.htm

P.S. I used "test_js" as the filename prefix as I have other
"test_" prefixed files in the same folder.
Nov 16 '06 #5
"McKirahan" <Ne**@McKirahan.comwrote in news:VoCdnZ-
9e***********************@comcast.com:
Create the files, put them in a folder on a Web server,
then open the page via http://whatever/test_js.htm
Can you post the URL so we can test it online?
Nov 16 '06 #6
McKirahan wrote:
Has anyone experienced this (and found a solution)?

I have five files: a .htm that invokes four .js include files.

Only the first alert in the first include is displayed.

This only happens when I run on a client's corporate server.

I have no problems on a laptop connected to the network
or on my home PC. Any ideas? Thanks in advance.
<html>
<head>
<title>test_js.htm</title>
</head>
<body>
<script type="text/javascript" src="test_js.js"></script>
<script type="text/javascript" src="test_js.js1"></script>
<script type="text/javascript" src="test_js.js2"></script>
<script type="text/javascript" src="test_js.js3"></script>
The server probably doesn't understand what .js1, .js2, and .js3 files
are. And rightly so, since those are non-standard file extensions.
Rename your files

test_js.js
test_js1.js
test_js2.js
test_js3.js

and correct the associated calls to them, and all should be fine.

HTH.

--

*** Remove the DELETE from my address to reply ***

================================================== ====
Kevin Scholl http://www.ksscholl.com/
ks*****@comcast.DELETE.net
------------------------------------------------------
Information Architecture, Web Design and Development
------------------------------------------------------
We are the music makers, and we are the dreamers of
the dreams...
================================================== ====
Nov 16 '06 #7
"Kevin Scholl" <ks*****@comcast.DELETE.netwrote in message
news:Gq******************************@comcast.com. ..

[snip]
The server probably doesn't understand what .js1, .js2, and .js3 files
are. And rightly so, since those are non-standard file extensions.
Rename your files

test_js.js
test_js1.js
test_js2.js
test_js3.js

and correct the associated calls to them, and all should be fine.
I'm sure that's it -- I'll test it tomorrow.

Their server is IIS 6.0 while the others are IIS 5.1 and PWS.

Apparently it's a configuration issue.

Thanks.
Nov 17 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
5
by: Red | last post by:
Hi, I'm not very familiar with Javascript. I usually leave that kind of stuff up to Dreamweaver, but i'm starting to need a little more than it can offer. I have an asp page which creates a...
7
by: Erwin Moller | last post by:
Hi, situation: I have a long list of options in multiple selectbox. The selectbox gets a scrollbar in that situation. Does anybody know if it is possible to scroll through the options with...
19
by: Fabian | last post by:
Well, what can I say...I really hate Javascript. I am not programming as profession but I sometimes work with PHP with MySQL, ASP with Ms Access/SQL Server. I have done something in VB and when...
6
by: jan | last post by:
My apologies for being a javascript beginner and asking such a basic question. This is probably so easy that nobody ever mentions it. Tutorials and places that tell of basic commands never seem to...
1
by: Italian Pete | last post by:
Hi, I have a usercontrol which includes a small piece of Javascript built up as a string in <scripttags and put onto a web page when an instance of the User Control is created. The Javascript does...
1
by: Italian Pete | last post by:
Hi, I have a usercontrol which includes a small piece of Javascript built up as a string in <scripttags and put onto a web page when an instance of the User Control is created. The Javascript does...
4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.