Problem - JS file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yaron Cohen

    Problem - JS file

    Hi,

    I would like to ask for you help.

    I have a page that contains few JS files (please see below).

    The problem is that sometimes one of the files is not loaded (I am
    using IE 5.5).

    I get a run time error about object that is defined in
    "MeridianView.j s";


    <LINK REL="stylesheet " TYPE="text/css" HREF="../style.css">
    <SCRIPT language=JavaSc ript
    src="../JavaScript/MeridianView.js "></SCRIPT>
    <SCRIPT language=JavaSc ript src="../JavaScript/siteMenu.js"></SCRIPT>
    <SCRIPT language=JavaSc ript src="../JavaScript/table.js"></SCRIPT>
    <SCRIPT language=JavaSc ript src="../JavaScript/cookies.js"></SCRIPT>


    style.css size is 21k
    MeridianView.js size is 29k
    siteMenu.js size is 9k
    table.js size is 21k
    cookies.js size is 5k

    My page (asp file) size is 4k

    Did you heard about such problem before?

    Is my page (including the files) is too big?
    How can I prevent it?

    Do you think that moving to use persistent connection (can be used in
    HTTP/1.1) will be helpful?

    Thanks,

    Yaron

  • Stuart Palmer

    #2
    Re: Problem - JS file

    I personally would always reference the JS file with a absolute url rather
    than a relative, stopping mistakes of having the file in the worng location.
    This may not be your problem if it is sometimes loading but worth mentioning
    I think.

    Stu

    "Yaron Cohen" <yaronc@lyciumn etworks.com> wrote in message
    news:9kk4rvsvi9 ah0m6h17dts3ltp v5luav3du@4ax.c om...[color=blue]
    > Hi,
    >
    > I would like to ask for you help.
    >
    > I have a page that contains few JS files (please see below).
    >
    > The problem is that sometimes one of the files is not loaded (I am
    > using IE 5.5).
    >
    > I get a run time error about object that is defined in
    > "MeridianView.j s";
    >
    >
    > <LINK REL="stylesheet " TYPE="text/css" HREF="../style.css">
    > <SCRIPT language=JavaSc ript
    > src="../JavaScript/MeridianView.js "></SCRIPT>
    > <SCRIPT language=JavaSc ript src="../JavaScript/siteMenu.js"></SCRIPT>
    > <SCRIPT language=JavaSc ript src="../JavaScript/table.js"></SCRIPT>
    > <SCRIPT language=JavaSc ript src="../JavaScript/cookies.js"></SCRIPT>
    >
    >
    > style.css size is 21k
    > MeridianView.js size is 29k
    > siteMenu.js size is 9k
    > table.js size is 21k
    > cookies.js size is 5k
    >
    > My page (asp file) size is 4k
    >
    > Did you heard about such problem before?
    >
    > Is my page (including the files) is too big?
    > How can I prevent it?
    >
    > Do you think that moving to use persistent connection (can be used in
    > HTTP/1.1) will be helpful?
    >
    > Thanks,
    >
    > Yaron
    >[/color]


    Comment

    • Michael Winter

      #3
      Re: Problem - JS file

      "Stuart Palmer" wrote on 12/11/2003:
      [color=blue]
      > I personally would always reference the JS file with a absolute url[/color]
      rather[color=blue]
      > than a relative, stopping mistakes of having the file in the worng[/color]
      location.[color=blue]
      > This may not be your problem if it is sometimes loading but worth[/color]
      mentioning[color=blue]
      > I think.[/color]

      I would instead recommend specifying the base URL explicitly with the
      BASE element. It makes it clear what URLs are relative to, without
      being as verbose as using the entire address.

      Mike

      --
      Michael Winter
      M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)
      [color=blue]
      > Stu
      >
      > "Yaron Cohen" <yaronc@lyciumn etworks.com> wrote in message
      > news:9kk4rvsvi9 ah0m6h17dts3ltp v5luav3du@4ax.c om...[color=green]
      > > Hi,
      > >
      > > I would like to ask for you help.
      > >
      > > I have a page that contains few JS files (please see below).
      > >
      > > The problem is that sometimes one of the files is not loaded (I am
      > > using IE 5.5).
      > >
      > > I get a run time error about object that is defined in
      > > "MeridianView.j s";
      > >
      > >
      > > <LINK REL="stylesheet " TYPE="text/css" HREF="../style.css">
      > > <SCRIPT language=JavaSc ript
      > > src="../JavaScript/MeridianView.js "></SCRIPT>
      > > <SCRIPT language=JavaSc ript[/color][/color]
      src="../JavaScript/siteMenu.js"></SCRIPT>[color=blue][color=green]
      > > <SCRIPT language=JavaSc ript src="../JavaScript/table.js"></SCRIPT>
      > > <SCRIPT language=JavaSc ript[/color][/color]
      src="../JavaScript/cookies.js"></SCRIPT>[color=blue][color=green]
      > >
      > >
      > > style.css size is 21k
      > > MeridianView.js size is 29k
      > > siteMenu.js size is 9k
      > > table.js size is 21k
      > > cookies.js size is 5k
      > >
      > > My page (asp file) size is 4k
      > >
      > > Did you heard about such problem before?
      > >
      > > Is my page (including the files) is too big?
      > > How can I prevent it?
      > >
      > > Do you think that moving to use persistent connection (can be used[/color][/color]
      in[color=blue][color=green]
      > > HTTP/1.1) will be helpful?
      > >
      > > Thanks,
      > >
      > > Yaron
      > >[/color]
      >
      >[/color]


      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Problem - JS file

        Stuart Palmer wrote:
        [color=blue]
        > I personally would always reference the JS file with a absolute url rather
        > than a relative, stopping mistakes of having the file in the worng location.[/color]

        I would not since this increases efforts required for local
        testing or simply moving a site to another location.

        When the document is downloaded from a HTTP server, the Mozilla JavaScript
        console shows a script error in the case a 404 page has been defined and
        the script file cannot be found. I found that very useful to track down
        undeclared functions.
        [color=blue]
        > [Top posting][/color]

        Please stop wasting bandwidth and disk space:

        [color=blue]
        >"Yaron Cohen" <yaronc@lyciumn etworks.com> wrote[color=green]
        >> [...]
        >> <SCRIPT language=JavaSc ript
        >> src="../JavaScript/MeridianView.js "></SCRIPT>
        >> <SCRIPT language=JavaSc ript src="../JavaScript/siteMenu.js"></SCRIPT>
        >> <SCRIPT language=JavaSc ript src="../JavaScript/table.js"></SCRIPT>
        >> <SCRIPT language=JavaSc ript src="../JavaScript/cookies.js"></SCRIPT>[/color][/color]

        The OP should try

        <script
        src="../JavaScript/MeridianView.js "
        type="text/javascript"[color=blue]
        ></script>[/color]
        <script src="../JavaScript/siteMenu.js" type="text/javascript"></script>
        <script src="../JavaScript/table.js" type="text/javascript"></script>
        <script src="../JavaScript/cookies.js" type="text/javascript"></script>

        instead.
        [color=blue][color=green]
        >> style.css size is 21k
        >> MeridianView.js size is 29k
        >> siteMenu.js size is 9k
        >> table.js size is 21k
        >> cookies.js size is 5k
        >>
        >> My page (asp file) size is 4k[/color][/color]

        Now sum it up and think about a low-bandwidth (say a 56k analog modem) user
        that has JavaScript supported and enabled. Is the additional functionality
        really worth to wait this long?
        [color=blue][color=green]
        >> Did you heard about such problem before?[/color][/color]

        Yes, see above.
        [color=blue][color=green]
        >> Is my page (including the files) is too big?[/color][/color]

        The Magic Eight Ball says: Unlikely.
        [color=blue][color=green]
        >> How can I prevent it?[/color][/color]

        Check for the location of your files (use the location bar),
        and optimize the scripts where possible. If you used that
        scripts unreflected, you better discard them, learn JavaScript
        and the DOMs your are targeting and write it for yourselves.
        [color=blue][color=green]
        >> Do you think that moving to use persistent connection (can be used in
        >> HTTP/1.1) will be helpful?[/color][/color]

        No. It is a location or script issue, not a connection issue.


        PointedEars

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Problem - JS file

          Michael Winter <M.Winter@[no-spam]blueyonder.co.u k> wrote:
          ^^^^^^^^^[color=blue]
          > "Stuart Palmer" wrote on 12/11/2003:
          >[color=green]
          >> I personally would always reference the JS file with a absolute url[/color]
          > rather[color=green]
          >> than a relative, stopping mistakes of having the file in the worng[/color]
          > location.[color=green]
          >> This may not be your problem if it is sometimes loading but worth[/color]
          > mentioning[color=green]
          >> I think.[/color][/color]

          Please repair your newsreader:


          And use a valid e-mail address, according to the standards:

          [color=blue]
          > I would instead recommend specifying the base URL explicitly with the
          > BASE element. It makes it clear what URLs are relative to, without
          > being as verbose as using the entire address.[/color]

          As said before, using the `href' attribute of the `base' element
          increases maintenance effort. Thus I would not recommend it.


          PointedEars

          Comment

          Working...