您的位置:首页 > 编程语言 > PHP开发

用vsftp部署一个功能强大的ftp服务器

2013-08-18 08:20 197 查看
当在线项目使用js的时候,我们通常把js库打包到服务器上发布,我常遇到一些问题:项目的文档结构迁移的时候重构非常的麻烦.
引用的js库各家都一样,无形中浪费了带宽,Google的 jsapi就是集中管理这些js库用的.

这个是官网,上面的说明很清楚了,我这里罗嗦一下

它支持的js库包括

jQuery
jQuery UI
Prototype
script.aculo.us
MooTools
Dojo
SWFObject
Yahoo! User Interface Library (YUI)

使用这个API首先需要引入Google的js库,在<head>里头加上
<script src="http://www.google.com/jsapi"></script>

ok,它主要有2个函数,分别是加载js库的 load(js库名,版本) 和 类似onload的函数(在加载完js库后触发)

直接抓一个例子过来,加载jQuery 1.3.2

引用
<script src="http://www.google.com/jsapi"></script><script>
// Load jQuery
google.load("jquery", "1.3.2");

// on page load complete, fire off a jQuery json-p query
// against Google web search
google.setOnLoadCallback(function() {
$.getJSON("http://ajax.googleapis.com/ajax/services/search/web?q=google&v=1.0&callback=?",

// on search completion, process the results
function (data) {
if (data.responseData.results &&
data.responseData.results.length > 0) {
var results = data.responseData.results;

for (var i=0; i < results.length; i++) {
// Display each result however you wish
alert(results[i].titleNoFormatting);
}
}

});
});
</script>


最后它还有一个模拟器让大伙折磨 >.<
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐