Non sei loggato | Register | Login

25 consigli su jQuery Aggiungi

News / Codice

Giorni fa mi sono letto l'articolo "Improve your jQuery - 25 excellent tips" dove ho trovato dei consigli molto interessanti (sinceramente non tutti perchè alcuni erano banali).
Il consiglio che più mi ha "affascinato" è il seguente:

Google have been hosting several JavaScript libraries for a while now on Google Code and there are several advantages to loading it from them instead of from your server. It saves on bandwidth, it'll load very quickly from Google's CDN and most importantly it'll already be cached if the user has visited a site which delivers it from Google Code.

Cioè fare riferimento alla libreria prendendolo dal hosting di Google scrivendo:

  1. <script src="http://www.google.com/jsapi"></script> 
  2. <script type="text/javascript">
  3.      google.load("jquery", "1.2.6"); 
  4.      google.setOnLoadCallback(function() { 
  5.          // Your code goes here. 
  6.      });       
  7. </script>

Questa lettura è quindi la risposta al post "Google potrebbe hostare alcuni frameworks Javascript nei proprio server?".

Se volete saperne di più vi consiglio di leggere le Google AJAX Libraries API.

Daniele Simonin 29 June 2009 alle 10:13 Trackback URI

Scrivi un commento

Tags di formattazione:








Feed

infoPillole (by Wikipedia)

Ultimi commenti

Calendario

March 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  

Archivio

Categorie

News casuali

Ultimi tutorials

Progetti

Alcuni miei lettori

Have a break