欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery $.ajax入門應(yīng)用一

 更新時(shí)間:2008年11月19日 16:07:33   作者:  
這個(gè)方法把a(bǔ)jax方法封裝一下,方便調(diào)用
前臺(tái) 
復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>無標(biāo)題頁(yè)</title>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
//這個(gè)方法把a(bǔ)jax方法封裝一下,方便調(diào)用。
function myajax(){
$.ajax({
type:'get',
url:'ajax.aspx',
data:'',
dataType:'html',
success:callback
});
}
//回調(diào)函數(shù)
function callback(data){
$('#response').append(data);
}
//onload()事件
$(function(){
$('#confirm').click(myajax);
})
</script>
</head>
<body>
<div id="confirm">點(diǎn)擊</div>
<div id="response">接收后臺(tái)數(shù)據(jù)</div>
</body>
</html>

后臺(tái)
復(fù)制代碼 代碼如下:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("hello");
Response.End();
}
}

相關(guān)文章

最新評(píng)論