javascript in a separate file?

Discussion in 'HTML' started by John Salerno, Oct 30, 2006.

  1. John Salerno

    John Salerno Guest

    Hi guys. I'm just curious, is it possible to put your javascript in a
    separate file like you do with CSS? If so, is the syntax for including
    it the same as CSS?

    Thanks.
     
    John Salerno, Oct 30, 2006
    #1
    1. Advertisements

  2. John Salerno

    Vince Morgan Guest

    "John Salerno" <> wrote in message
    news:45455ac6$0$8782$...
    > Hi guys. I'm just curious, is it possible to put your javascript in a
    > separate file like you do with CSS? If so, is the syntax for including
    > it the same as CSS?
    >
    > Thanks.


    <script src="../myscript.js"></script>

    HTH
    Vince Morgan
     
    Vince Morgan, Oct 30, 2006
    #2
    1. Advertisements

  3. Vince Morgan wrote:

    > "John Salerno" <> wrote:
    >> Hi guys. I'm just curious, is it possible to put your javascript in a
    >> separate file like you do with CSS? If so, is the syntax for
    >> including it the same as CSS?

    >
    > <script src="../myscript.js"></script>


    <script type="text/javascript" src="../myscript.js"></script>

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Oct 30, 2006
    #3
  4. John Salerno

    John Salerno Guest

    Beauregard T. Shagnasty wrote:
    > Vince Morgan wrote:
    >
    >> "John Salerno" <> wrote:
    >>> Hi guys. I'm just curious, is it possible to put your javascript in a
    >>> separate file like you do with CSS? If so, is the syntax for
    >>> including it the same as CSS?

    >> <script src="../myscript.js"></script>

    >
    > <script type="text/javascript" src="../myscript.js"></script>
    >


    Thanks!
     
    John Salerno, Oct 30, 2006
    #4
    1. Advertisements

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. Replies:
    6
    Views:
    730
  2. Pavan Apuroop

    Code behind file in separate folder

    Pavan Apuroop, Jun 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,095
    Juan T. Llibre
    Jun 24, 2005
  3. David
    Replies:
    4
    Views:
    523
    Mythran
    Jul 19, 2005
  4. EvgueniB
    Replies:
    1
    Views:
    859
    Anthony Borla
    Dec 15, 2003
  5. Frank Fredstone
    Replies:
    1
    Views:
    625
    Jean-Francois Briere
    Jun 27, 2006
  6. Replies:
    1
    Views:
    725
  7. Replies:
    1
    Views:
    563
    Roedy Green
    Aug 29, 2012
  8. Replies:
    0
    Views:
    485
Loading...