为了避免每次为了一个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=utf-8" />
<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(){
$("body").html("OK!");
})
});
</script>
</head> <body>
<div id="gj"></div>
</body>
</html>