What's 'best practice' when using Javascript?

Discussion in 'JavaScript' started by pictureboarduk, Jan 23, 2009.

  1. #1
    Hi,

    I am new to using Javascript and am creating a 5 page website. Two of the pages use JavaScript.

    On page uses it for form validation (only).

    Another page uses it to operate an image slideshow (only).

    Can/should I place all the scripts into a single external .js file?

    Or should I use a separate and individual .js file for each of the two pages?




    I thank you for any advice.
     
    pictureboarduk, Jan 23, 2009 IP
  2. symbol.software

    symbol.software Member

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #2
    Use separate js files. do not include unnecessary js in your pages.
     
    symbol.software, Jan 25, 2009 IP
    pictureboarduk likes this.