"Include"ing a javascript file.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dany P. Wu

    "Include"ing a javascript file.

    Hi everyone,

    I downloaded a custom scroll bar script from this site:



    Can someone please tell me if it is possible to have a few lines in a page
    that will include the script in another file? I guess I just think repeating
    the code in every page is a bit wasteful and not great management. It would
    be helpful if I can have the script in another file and just "include" it in
    the pages. I'm using the term "include" like in C/C++

    Excuse my ignorance, I'm fairly new to HTML and Javascript.

    Cheers,
    Dany.


  • Michael Winter

    #2
    Re: "Include&q uot;ing a javascript file.

    On Sat, 31 Jan 2004 09:58:45 +1300, Dany P. Wu
    <dany@nospam.qu icksilver.net.n z> wrote:
    [color=blue]
    > Can someone please tell me if it is possible to have a few lines in
    > a page that will include the script in another file? I guess I just
    > think repeating the code in every page is a bit wasteful and not
    > great management. It would be helpful if I can have the script in
    > another file and just "include" it in the pages. I'm using the term
    > "include" like in C/C++[/color]

    This was discussed a while ago. Search the Google Groups archives for the
    thread "Javascript equivalent of #include or @import?".

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • Dany P. Wu

      #3
      Re: &quot;Include&q uot;ing a javascript file.

      In news:opr2l4svjg 5vklcq@news-text.blueyonder .co.uk,
      Michael Winter <M.Winter@bluey onder.co.invali d> typed:[color=blue]
      > On Sat, 31 Jan 2004 09:58:45 +1300, Dany P. Wu
      > <dany@nospam.qu icksilver.net.n z> wrote:
      >[color=green]
      >> Can someone please tell me if it is possible to have a few lines in
      >> a page that will include the script in another file? I guess I just
      >> think repeating the code in every page is a bit wasteful and not
      >> great management. It would be helpful if I can have the script in
      >> another file and just "include" it in the pages. I'm using the term
      >> "include" like in C/C++[/color]
      >
      > This was discussed a while ago. Search the Google Groups archives for
      > the thread "Javascript equivalent of #include or @import?".
      >
      > Mike[/color]

      Thank you - I found the threat and the answer to my question.

      Cheers,
      Dany.


      Comment

      Working...