Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Multiple JavaScript includes fail

Reply
Thread Tools

Multiple JavaScript includes fail

 
 
McKirahan
Guest
Posts: n/a
 
      11-16-2006
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.


 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      11-16-2006
"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.com> wrote in message
news:Xns987CF27E82108RrrrFfffTttt4396hotm@216.168. 3.44...
> "McKirahan" <> wrote in newseudnXL4
> _:
>
> > 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.


 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      11-16-2006
"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.com> wrote in message
news:Xns987D62931B7F7RrrrFfffTttt4396hotm@216.168. 3.44...
> "McKirahan" <> wrote in news:uZ-
> :
>
> > 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.


 
Reply With Quote
 
Kevin Scholl
Guest
Posts: n/a
 
      11-16-2006
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/

------------------------------------------------------
Information Architecture, Web Design and Development
------------------------------------------------------
We are the music makers, and we are the dreamers of
the dreams...
================================================== ====
 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      11-17-2006
"Kevin Scholl" <> wrote in message
news:GqednVOgFq-...

[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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevents multiple includes of the same module Zouplaz Ruby 1 10-11-2008 05:36 PM
Javascript includes not recognised Martin Walke ASP General 25 02-18-2004 04:01 AM
Javascript includes Jon Booth ASP .Net Web Controls 3 01-07-2004 12:51 AM
Multiple includes with RequestDispatcher Paul Vincent Craven Java 0 08-29-2003 03:53 PM
if (f() != FAIL) or if (FAIL != f())? Wenjie C Programming 3 07-31-2003 09:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57