Combine JS to an External file.

Discussion in 'JavaScript' started by suwandichen13, Jul 3, 2012.

  1. #1
    Hello.
    i just to be point okey...^^
    how to combine JS to an external file in order reducing http request.
    i have this script at my head section.
    <script type="text/javascript" src="www.example.com/javascripts/jquery.min.js"></script>
    <script src="www.example.com/javascripts/ajax.js" type="text/javascript"></script>
    <script type="text/javascript" src="www.example.com/javascripts/jquery/jquery-ui.custom.min.js"></script>
    <script type="text/javascript" src="www.example.com/javascripts/jquery.validates.js"></script>

    <script type="text/javascript">
    {literal}jQuery.noConflict();{/literal}
    </script>

    so i try add like this.
    i copy this following code to notepad like this.
    **** <script type="text/javascript" src="www.example.com/javascripts/jquery.min.js"></script>
    <script src="www.example.com/javascripts/ajax.js" type="text/javascript"></script>
    <script type="text/javascript" src="www.example.com/javascripts/jquery/jquery-ui.custom.min.js"></script>
    <script type="text/javascript" src="www.example.com/javascripts/jquery.validates.js"></script>

    <script type="text/javascript">
    {literal}jQuery.noConflict();{/literal}
    </script> ***** and name by example.js

    and put new code at head section <script type="text/javascript" src="www.example.com/javascripts/example.js"></script>
    it's already good?? thanks
     
    suwandichen13, Jul 3, 2012 IP
  2. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Sigh no one gimme advice..T.T
     
    suwandichen13, Jul 5, 2012 IP