474,045 Members | 43,439 Online
Bytes | Software Development & Data Engineering Community
+ 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.js 1"></script>
<script type="text/javascript" src="test_js.js 2"></script>
<script type="text/javascript" src="test_js.js 3"></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 1960
"McKirahan" <Ne**@McKirahan .comwrote in news:DeudnXL4
_b************* *********@comca st.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.js 1"></script>
<script type="text/javascript" src="test_js.js 2"></script>
<script type="text/javascript" src="test_js.js 3"></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.js 1"></script>
</body>

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

<body>
<script type="text/javascript" src="test_js.js 3"></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(N O)@(SPAM)hotmai l.comwrote in message
news:Xn******** *************** ***********@216 .168.3.44...
"McKirahan" <Ne**@McKirahan .comwrote in news:DeudnXL4
_b************* *********@comca st.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.js 1"></script>
<script type="text/javascript" src="test_js.js 2"></script>
<script type="text/javascript" src="test_js.js 3"></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.js 1"></script>
</body>

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

<body>
<script type="text/javascript" src="test_js.js 3"></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(N O)@(SPAM)hotmai l.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************* **********@comc ast.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.js 1"></script>
<script type="text/javascript" src="test_js.js 2"></script>
<script type="text/javascript" src="test_js.js 3"></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*****@comcas t.DELETE.netwro te 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
5856
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 difficult to know what is going on. One of these Order Forms you can see here... http://www.cardman.co.uk/orderform.php3
5
2626
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 form from a record set. Very simply it lists items that can be ordered by the customer. The customer simply enters the required qty for each item and hits submit:
7
1989
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 javascript? eg: moving the to the first selected option??
19
2134
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 I was jounger I worked with C. But what happens with Javascript, it happens with no other language. I work with WinXP SP2 & IIS5, now. But also with Win2k and win98, as fas as I remember, it was the same. I always keep my PC updated with
6
1868
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 mention what I want to do. I've looked into SSI, shtml, external javascript, css, and html commands. There seems to be many solutions, but I would like to focus on using the best and easiest solution. I have a website with more than 1000 pages....
1
1909
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 some client side checking of User Input. If I use multiple instances of the same user control on a page, the same block of Javascript is repeatedly written to the page (once for each instance of the user control). Although the user controls...
1
2402
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 some client side checking of User Input. If I use multiple instances of the same user control on a page, the same block of Javascript is repeatedly written to the page (once for each instance of the user control). Although the user controls...
4
3872
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. My client-side JavaScript function takes 4 parameters (which are expected to be integers). The idea of passing a single parameter and parsing it on the client has occurred to me, but since I am sure I am not the only person who has situations that...
3
7865
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" src="funcs3.js"></script> ? And I need to use similarly multiple CSS:
0
10337
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
12140
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11602
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
11141
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8698
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6652
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5416
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 we have to send another system
2
4944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.