Ao utilizar jQuery em um site, você precisa baixar o arquivo contendo a biblioteca JavaScript que simplifica percorrer documentos HTML, manipulação de eventos, animação e interações Ajax para um desenvolvimento web rápido. Uma solução para não se preocupar em ficar baixando arquivo ou com a versão atual da API é utilizar Google Libraries API.
O primeiro exemplo é utilizado através do link onde chama a API direto do site do google com a biblioteca.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>POPUP com jQuery</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="scriptsjquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a').click(function(){
$(this).open();
});
});
</script>
</head>
<body>
<a href="javascript:void(0);">Testando jQuery do Google</a>
</body>
</html> Neste exemplo você passa os argumentos nome da biblioteca e a versão Se você optar por carregar bibliotecas com google.load , você também precisa definir o método google.setOnLoadCallback .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ajax Libraries API</title>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
//Carrega biblioteca jQuery e sua versão
google.load("jquery", "1.7.1");
google.setOnLoadCallback(function() {
$(document).ready(function() {
$('a').click(function() {
alert("Utilizando API jQuery do Google");
});
});
});
</script>
</head>
<body>
<a href="javascript:void(0);">Testando jQuery do Google</a>
</body>
</html> Parâmetro Web 2009 - 2012