SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Location
    delhi
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to place multiple javascripts in a webpage

    Hi,

    while checking the speed performance of one my webpage I found suggestion "This page has 9 external Javascript scripts. Try combining them into one." I don't know how to manage to combine them in one.

    Could anyone suggest me how to do that or any other way to make it better. I want this on multiple pages.

  2. #2
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    To combine them into one you... Combine them into one. Lol. Just put them in the same order they currently are. Place the link at the bottom just above the closing body tag.

  3. #3
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    As Eric says, just combining them into one and placing them at the bottom of your document will work fine.

    However, there are also various tools available which will do this for you, but which also bring a few other benefits, such as removing unnecessary whitespace and comments, and serving them with gzip encoding and optimal client-side cache headers.

    There's a good discussion of this on StackOverflow: http://stackoverflow.com/questions/4...files-into-one


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •