简单AJAX 使用
var xmlHttp;
function createXMLHttpRequestss() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(){
var projectName = document.getElementById("pronameid").value;
var alarmName = document.getElementById("alarmNameId").value;
var url = "getAgentNo.action?randcount="+Math.random()+"&code="+document.getElementById("selectId").value+"&alarmName="+alarmName+"&projectName="+projectName+"&skillName="+document.getElementById("skillGroupId").value;
createXMLHttpRequestss();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("get",url,false);
xmlHttp.send(null);
}
function handleStateChange(){
if(xmlHttp.readyState == 4 ) {
if(xmlHttp.status == 200) {
if(xmlHttp.responseText == null || xmlHttp.responseText == ""){
return;
}
var obj =eval('('+ xmlHttp.responseText+')');
相关文档:
首先都是使用VS.Net2005创建一个 ASP.Net AJAX-Enabled Web Application
1、使用AJAX直接调用后台方法:
后台代码:
namespace AJAX1
{
public partial class _Default : System.Web.UI.Page
{
// 需要标识为WebMethod ......
http://drupal.org/project/ajax_comments
AJAX Comments
View
CVS instructions
Modules · Content display
neochief - December 18, 2008 - 12:44
One of the most wanted Drupal modules :)
Module is now depends on Comments bonus API!
Features in 6.x:
Provides ajax comments to drupal sites. Feature ......
一、XMLHttpRequest 对象的方法与属性
方 法
描 述
abort()
停止当前请求
getAllResponseHeaders()
把HTTP请求的所有响应首部作为键/值对返回
getResponseHeader("header")
返回指定首部的串值
open("method", "url")
建立对服务器的调用。method参数可以是GET、POST或PUT。 ......