ajaxºóOnSubmitÎÞЧ£¿ - Web ¿ª·¢ / Ajax
a.asp
------------------------------------------------<SCRIPT language=javascript src="check.js"></SCRIPT>
<input type="button" value="²âÊÔ" onclick="test(0);">
<span id="cc"></span>
check.js
------------------------------------------------
function test(str)
{
var xmlhttp=createxmlhttprequest();
xmlhttp.open('get',encodeURI('Check.asp?cj_id='+str+'&'+new Date().getTime()),false);
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status==200)
{
var pnum=xmlhttp.responseText;
document.getElementById("cc").innerHTML=pnum;
}
}
}
xmlhttp.send(null);
}
check.asp
------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
function ck()
{
if (document.theform.bang.value=="")
{
alert("³ö´íÀ²£¡");
document.theform.bang.focus()
return false;
}
return true;<
Ïà¹ØÎÊ´ð£º
ajaxÔõôʵÏÖÐÂÔöÏÂÀÁбíÎÞˢС£ÀàËÆ
http://hi.baidu.com/comasp/blog/item/aa34e736bfc269320a55a9ad.html¡£
»¹ÓÐÍøÒ×163Blog£¬Ìí¼Óblogʱ£¬Èç¹ûдµÄÎÄÕÂûÓкÏÊʵķÖÀà¿ÉÑ¡£¬¿ÉÒÔµã»÷Ìí¼ÓеÄÎÄÕÂÀàÐÍ£¬È»ºóÌ ......
°´Å¥·ÅÔÚUpdatePanel1£¬Ïëͨ¹ýµã»÷µ÷ÓÃDictionaryTvAdd.aspxµ¯³öÒ»¸ö×Ó´°Ìå
ÓÃÏÂÃæµÄÓï¾äÌáʾÎÒȱÉÙ¶ÔÏó
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.R ......
Hi£¬everybody£¡
×î½üÓÐÒ»¸öϵͳÏÔʾ²ãÓõÄÊÇstruts£¬ÆäÖÐÓÐÒ»¸ö¹¦ÄܾÍÊÇ£¬ÔÚÒ»¸öjspÒ³ÃæÉÏÓкܶà±í¸ñ£¬Ã¿Ò»¸ö±í¸ñÉ϶¼ÓÐÒ»¸ö¶ÔÓ¦µÄidµ±µã»÷Õâ¸ö±í¸ñµÄʱºòµ¯³öÒ»¸öģ̬¶Ô»°¿ò£¬È»ºóÊäÈëÄÚÈÝÔÙÌá½»£¡ÒªÇó¾Í ......
ÎÒÔÚÒ»¸öhtmlÖÐдÈçÏ´úÂ룺
JScript code:
<html>
<head>
<script type="text/javascript" charset="utf-8"
src="script/jquery-1.3.2.min ......
ÀûÓÃAjax´«µÝÒ»¸ö²ÎÊýµ½getreslt.asp£¬µ«ÊÇ·¢ÏÖgetreslt.aspÓ¦¸ÃÊÇûÄÜ»ñÈ¡µ½£¬¼ì²éÁË·¢ËͲ¿·Ö£¬Ó¦¸ÃÊÇ·¢³öÈ¥Á˵ģ¬µ±Ö¸¶¨getreslt.aspµÄ²éѯÌõ¼þ£¬Ò²Äܵõ½responseµÄ½á¹û¡£Âé·³¸÷λ¿´¿´£¬Õâ¸öÊÇ·¢ËͲ¿·ÖÓÐÎÊÌ⻹ÊÇ ......