about multiple scripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ricardo Garcia

    #1

    about multiple scripts

    hi , in some of my pages i use several files .js, and i wanted to know how
    to get the highest performance:
    - Joint all my .js in just one, so the http request nonpersistant get
    very accelerated
    - One file per script, so in many pages i only download the ones that i
    use

    Thanks


  • Randy Webb

    #2
    Re: about multiple scripts

    Ricardo Garcia wrote:
    [color=blue]
    > hi , in some of my pages i use several files .js, and i wanted to know how
    > to get the highest performance:
    > - Joint all my .js in just one, so the http request nonpersistant get
    > very accelerated
    > - One file per script, so in many pages i only download the ones that i
    > use[/color]

    Only include what you need to use.


    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: about multiple scripts

      Ricardo Garcia wrote:
      [color=blue]
      > hi , in some of my pages[/color]

      There are no (Internet) pages, you mean HTML documents,
      more often displayed continuously instead of pagewise.
      [color=blue]
      > i use several files .js, and i wanted to know how to get the highest
      > performance:
      > - Joint all my .js in just one, so the http request nonpersistant get
      > very accelerated[/color]

      Don't. You would include more features (and force the user to download
      the respective source code) that you don't use than you actually use.
      [color=blue]
      > - One file per script, so in many pages i only download the ones that
      > i[/color]

      I don't understand what you mean by "script", maybe you mean "function" or
      "method". If so, group functions/methods serving a similar purpose and
      preferably those that depend on each other in one script file, so you have
      to include only those functions that you actually use. You can find
      examples at <http://pointedears.de/scripts/>.


      HTH

      PointedEars
      --
      Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: about multiple scripts

        Ricardo Garcia wrote:
        [color=blue]
        > hi , in some of my pages[/color]

        There are no (Internet) pages, you mean HTML documents,
        more often displayed continuously instead of pagewise.
        [color=blue]
        > i use several files .js, and i wanted to know how to get the highest
        > performance:
        > - Joint all my .js in just one, so the http request nonpersistant get
        > very accelerated[/color]

        Don't. You would include more features (and force the user to download
        the respective source code) that you don't use than you actually use.
        [color=blue]
        > - One file per script, so in many pages i only download the ones that
        > i use[/color]

        I don't understand what you mean by "script", maybe you mean "function" or
        "method". If so, group functions/methods serving a similar purpose and
        preferably those that depend on each other in one script file, so you have
        to include only those functions that you actually use. You can find
        examples at <http://pointedears.de/scripts/>.


        HTH

        PointedEars
        --
        Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.

        Comment

        Working...