ajax repeater·ÖÒ³
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<mce:style type="text/css"><!--
.n{TEXT-DECORATION:none;cursor:pointer} a{color:black} a:hover{color:blue}
.m{TEXT-DECORATION:none;cursor:default} a{color:black}
--></mce:style><style type="text/css" mce_bogus="1"> .n{TEXT-DECORATION:none;cursor:pointer} a{color:black} a:hover{color:blue}
.m{TEXT-DECORATION:none;cursor:default} a{color:black}
</style>
<mce:script type="text/javascript"><!--
var xmlHttp = null;
var index, size = "10";
function $(id) {
return document.getElementById(id);
}
function createXMLHttpRequest() {
if (xmlHttp == null) {
if (window.XMLHttpRequest) {
//Mozilla ä¯ÀÀÆ÷
xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
// IEä¯ÀÀÆ÷
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert('´´½¨Ê§°Ü');
}
}
}
}
}
function openAjax(para) {
if (xmlHttp == null) {
createXMLHttpRequest();
if (xmlHttp == null) {
alert('³ö´í');
return;
}
}
xmlHttp.open("post", "RepeaterDemo.aspx?date=" + new Date().getTime(), true);
xmlHttp.onreadystatechange = xmlHttpChange;
xmlHttp, s
Ïà¹ØÎĵµ£º
Ajax ¸ø XMLHttpReq.onreadystatechange´«µÝ²ÎÊý
ͨ¹ý£º
xmlhttp.onreadystatechange= function(){xx(123)};
or
xmlhttp.onreadystatechange= new Function("xx(123)");
¾Í¿ÉÒÔÁË¡£
m=document.getElementsByName("text8");
v=m[i];
XMLHttpReq.onreadystatechange=function(){proce(v)};
---------------------- ......
Web¿ª·¢Õß²»»á×¢Òâµ½ÓÉ “AJAX(Asynchronous JavaScript And XML)”Ëù´øÀ´µÄ¼¤Çé¡£²»·ÑÁ¦Æø¾ÍÄÜ´´½¨ÏñGoogle SuggestÄÇÑùµÄÖÇÄÜÍøÕ¾»òÕßÏñGmailÄÇÑù»ùÓÚWebµÄÓ¦ÓóÌÐò£¬ÕâÔںܴó³Ì¶ÈÉÏÒª¹é¹¦ÓÚÕâÖÖ¼¼Êõ¡£È»¶ø£¬°éËæ×ÅAJAXÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÎÒÃÇ·¢ÏÖÁËËüµÄһЩ²»×ãÖ®´¦£¬ÎÒÃÇ·¢ÏÖËüµÄ°²È«Â©¶´Ò²ÔÚÖð½¥±ä´ó£¬¾ÍÏñÂý ......
1¡¢´´½¨
XMLHttpRequest
¶ÔÏóµÄÒ»¸öʵÀý
var xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if ( ......
1¡¢µ±¸Ä±ä·þÎñÆ÷ÉϵÄ״̬ʱӦµ±Ê¹ÓÃPOST·½·¨¡£²»Í¬ÓÚGET£¬ÐèÒªÉèÖÃXML- HttpRequest¶ÔÏóµÄContent-TypeÊײ¿£¬ÈçÏÂËùʾ£º
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ÓëGET²»Í¬£¬POST²»»áÏÞÖÆ·¢Ë͸ø·þÎñÆ÷µÄ¾»ºÉµÄ´óС£¬¶øÇÒPOSTÇëÇó²»Äܱ£Ö¤ÊÇÃݵȵġ£
Äã×öµÄ´ó¶àÊýÇëÇó¿ÉÄܶ¼ÊÇG ......
//AjaxÓ¦ÓõÄÎå¸ö²½Öè
//1.´´½¨XMLHttpRequest¶ÔÏó
var xmlHttp=createXMLHttpRequest();
function createXMLHttpRequest()
{
var xmlHttp;
if(Window.XMLHttpRequest)
{
//IE6ÒÔÉϰ汾ºÍÆäËûä¯ÀÀÆ÷ÄÚÖÃXMLHttpRequest¶ÔÏó
xmlHttp=new XMLHttpRequest();
......