Google Ajax Search API的基本使用方法
Google Search API
参考书籍:Google API大全—编程?开发?实例
书籍对几十种Google常用API进行了梳理和介绍,辅以行之有效的代码实例
http://code.google.com/intl/zh-CN/apis/ajaxsearch/documentation/
1)Google Site Search
Google站点内嵌搜索的使用方法
<%@ page language="java" contentType="text/html; charset=GBK"%>
<html>
<head>
<title>首页</title>
</head>
<body>
站内全文搜索,谷歌合作提供
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/custom"
target="google_window">
<table border="0" bgcolor="#ffffff">
<tr>
<td nowrap="nowrap" valign="top" align="left" height="32"></td>
</tr>
<tr>
<td nowrap="nowrap"><input type="hidden" name="domains"
value="njmars.net"></input> <label for="sbi" style="display: none">输入您的搜索字词</label>
<input type="text" name="q" size="20" maxlength="255" value=""
id="sbi"></input> <label for="sbb" style="display: none">提交搜索表单</label>
<input type="submit" name="sa" value="Google 搜索" id="sbb"></input></td>
相关文档:
在《Pragmatic Ajax A Web 2.0 Primer 》中偶然看到对readyStae状态的介绍,感觉这个介绍很实在,摘译如下:
0: (Uninitialized) the send( ) method has not yet been invoked.
1: (Loading) the send( ) method has been invoked, request in progress.
2: (Loaded) the send( ) method has completed, entire respons ......
到此为止,你可能已经注意到,使用Ajax编程时有很多麻烦事。如果你要支持多个浏览器(现在还有谁只支持一个浏览器呢?),无疑会遭遇不兼容问题。单看一个简单的动作,比如说创建XMLHttpRequest对象的一个实例,这需要先进行浏览器测试。一旦开始尝试使用Ajax技术,你很快就会注意到要反复地完成同样的一些任务。当然, ......
$.ajax({
url: "auto_action.jsp",
type: "POST",
data: {nickName:request.term},
contentType :"application/x-www-form-urlencoded;charset=UTF-8", //加上这句就可以了!
& ......
最近一直在寻找一个比较方便好用的树控件,MyTree树控件并没有提供很多其他的功能,但在Ajax异步加载节点上实现的很简洁,留作备忘。
MyTree的下载地址:http://www.itplus.com.cn/myTree/
下载后 Demo:Ajax异步加载例子
Document:文档
......
折腾了好长时间,终于在今天用JsTree插件实现了Ajax异步加载节点的功能。
Zero.aspx页,该页用于显示树控件。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Zero.aspx.cs" Inherits="VistaToNewSchol.Zero" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ ......