Multiple JavaScript includes fail

Discussion in 'Javascript' started by McKirahan, Nov 16, 2006.

  1. McKirahan

    McKirahan Guest

    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.
    McKirahan, Nov 16, 2006
    #1
    1. Advertising

  2. McKirahan

    McKirahan Guest

    "Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.com> wrote in message
    news:Xns987CF27E82108RrrrFfffTttt4396hotm@216.168.3.44...
    > "McKirahan" <> wrote in news:DeudnXL4
    > :
    >
    > > 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.
    McKirahan, Nov 16, 2006
    #2
    1. Advertising

  3. McKirahan

    McKirahan Guest

    "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.
    McKirahan, Nov 16, 2006
    #3
  4. McKirahan

    Kevin Scholl Guest

    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...
    ======================================================
    Kevin Scholl, Nov 16, 2006
    #4
  5. McKirahan

    McKirahan Guest

    "Kevin Scholl" <> wrote in message
    news:...

    [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.
    McKirahan, Nov 17, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Vincent Craven

    Multiple includes with RequestDispatcher

    Paul Vincent Craven, Aug 29, 2003, in forum: Java
    Replies:
    0
    Views:
    646
    Paul Vincent Craven
    Aug 29, 2003
  2. Wenjie

    if (f() != FAIL) or if (FAIL != f())?

    Wenjie, Jul 28, 2003, in forum: C Programming
    Replies:
    3
    Views:
    430
    E. Robert Tisdale
    Jul 31, 2003
  3. Jon Booth

    Javascript includes

    Jon Booth, Jan 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    100
    Jon Booth
    Jan 7, 2004
  4. Martin Walke

    Javascript includes not recognised

    Martin Walke, Feb 17, 2004, in forum: ASP General
    Replies:
    25
    Views:
    321
    Ken Schaefer
    Feb 18, 2004
  5. Zouplaz
    Replies:
    1
    Views:
    81
    Thomas B.
    Oct 11, 2008
Loading...

Share This Page