ajaxÌá½»µÈ´ýÎÊÌâ - .NET¼¼Êõ / ASP.NET
ÎÒ×öÁ˸ö¼òµ¥µÄ×¢²áʱ£¬×Ô¶¯²éÕÒÓû§ÃûÊÇ·ñ¿ÉÓõÄÀý×Ó£¬ÊµÏÖÁË¡£µ«ÊÇÎÒÏÖÔÚÏëµ±ÕýÔÚ²éÕÒÊý¾Ý¿âʱ£¬ÏÔʾһÕÅÕýÔڵȴýµÄͼƬ£¬Õâ¸öÔõôʵÏÖÄØ£¿Ð»Ð»¡£
ÎÒµÄһЩ´úÂë
function checkUserNameResult()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
if(xmlHttp.responseText=="true")
{
document.getElementById("imgflag").src="false.GIF";
}
else
{
document.getElementById("imgflag").src="true.GIF";
}
}
}
}
function check_user(id) {
if (id == "")
return;
document.getElementById("userid_msg").innerHTML = "<img src='images/loading.gif' align='absMiddle'> ¼ì²éÖУ¬ÇëÉÔºò¡¡";
var url = "../RegistValidate.ashx?username=" + escape(id);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = ShowResult;
xmlHttp.send(null);
}
function ShowResult() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
var s;
s
Ïà¹ØÎÊ´ð£º
°´Å¥·ÅÔÚUpdatePanel1£¬Ïëͨ¹ýµã»÷µ÷ÓÃDictionaryTvAdd.aspxµ¯³öÒ»¸ö×Ó´°Ìå
ÓÃÏÂÃæµÄÓï¾äÌáʾÎÒȱÉÙ¶ÔÏó
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.R ......
<script language="javascript">
var XMLHttpReq;
var cont=true;
//´´½¨XMLHttpRequest¶ÔÏó
function createXMLHttpRequest ......
´úÂëÖУ¬Èç¹û½«//alert(1)¡¡×¢ÊÍ´ò¿ª£¬ÄÇô¾Í¿ÉÒÔµ÷Óã¬Èç¹û×¢Ê͵ô¾ÍÎÞ·¨µ÷ÓÃ
»³ÒÉÊǵ¼JSÎļþ³öÎÊÌâÁË£¬ÒòΪд¹ýjspÒýÁ½¸öJSÎļþûÎÊÌ⣬
¶øJSPÒýÒ»¸öJSÎļþ£¬Õâ¸öJSÒý±ðÍâµÄJSÎļþ³öÏÖÏÂÃæÎÊÌ⣬ÉÏÍøÕÒÁË°ëÌìû½á ......
´úÂëÈçÏ Çë¸ßÊÖ Ö¸µãÏ лл
ajax_http.js
-------------
function getXMLHTTP() {
var xmlhttp;
if (window.ActiveXObject) {
//IE
try {
......
ÎÊÌâ: ÏÖÔÚÌá½»Ö®ºó¾Í²»ÄÜÌøµ½ajax.jsÖÐÖ¸¶¨µÄservlet
¶øÊÇÓÖÖØнøÈëµ½ÁËpub_hotel_t.jspÒ³Ãæ. Ò²¾ÍÊÇûÓÐÖ´Ðе½ajaxÀïÃæÈ¥ ´ó¼Ò°ïæ¿´¿´ÊÇʲôÔÒò°É.
ÊDz»ÊǺÍÌá½»µÄ°´Å¦ÓйØÄ ......