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 ......
使用原始的XMLHttpRequest发出请求时,只能对Servlet和JSP操作
在JSP中创建3个function
1.createXmlHttpRequest----负责判断浏览器类型创建 XMLHttpRequest对象
var xmlHttpRequest;
function createXMLHttpRequest(){
// IE 浏览器
if(window.ActiveXObject){
&nbs ......
我的春秋痴梦第二步:
写一个 通用的 对象 列表 ,还 包含 搜索和 属性过滤。
具体的效果是:
当新 业务 添加一个 表的时候,只需要在 对象模型里的 添加一个 model
后台几乎不需写代码。
(我是后台:激动人心!)
调用的对象,第几页,属性的 过滤 和搜索全是 前台的Ajax参数控制
(我是前台:#$!@#$%$^#$% ......
A.aspx页面放一个dropdownlist,在A.aspx.cs添加: this.drpSchool.Attributes.Add("onchange", "load(this.options[this.selectedIndex].value)");
在A.aspx页面添加如下脚本:
function load(state){
var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
......
1、区块的显示与隐藏
在进行ajax编程时,经常会用到div标签对页面元素进行布局,大致方法是,把界面分做几大块,有时候需要根据点击菜单显示相应的块及隐藏其他块,这时可简单设置div.style.display为block进行显示,div.style.dispaly为none进行隐藏。
2、界面元素命名
&nb ......