为了避免每次为了一个jquery效果都要放进去一个”jquery.min.js”或是”jquery.js”.
从google直接加载(调用)是一个很方便的办法,而且据传有缩短延迟,提高并行加载速度等好处.
<!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=gb2312" />
<title>谷歌JSAPI测试</title>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery","1.3.2");
google.setOnLoadCallback(
function(){
$(document).ready(
function(){
$("#gj").text("成功调用了谷歌的JQuery!");
})
}
);
</script>
</head> <body>
<div id="gj"></div>
</body>
</html>
另:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> (据说:这种加载速度较快)
来源:http://shiyun1013.blog.163.com/blog/static/1077403620111111441638/