1

I want to ask which practise is better/faster(in terms of loading times) for javascripts like http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

I have the above script in my webpage like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Is it beter to donwload it to my web folder and link it localy?

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

Will this move affect the loading times?Is it better html coding like this?

Thank you!

Theodoros80
  • 796
  • 2
  • 15
  • 43
  • The safest way is probably this: http://stackoverflow.com/questions/1014203/best-way-to-use-googles-hosted-jquery-but-fall-back-to-my-hosted-library-on-go – kimpettersen Sep 17 '12 at 18:30

2 Answers2

1

Unless you are doing an offline app, linking from google will generally speed up your app since there is a VERY good chance it is cached on someone's browser

Lance
  • 3,193
  • 2
  • 32
  • 49
0

You could try both and check the load times under the network tab in your web inspector tool. This will tell you how long it takes for something to load. In my opinion though I prefer to not be dependent off of someone else's resources.

khollenbeck
  • 16,028
  • 18
  • 66
  • 101