<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="ashx_jQuery._default" %>
<!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 runat="server">
<title>jQuery ashx Sample</title>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$().ready(function () {
$("#btnTest").click(function () {
$.post(
"AjaxProcess.ashx",
{ month:1 },
function (e) {
var d = eval("(" + e + ")");
alert(d.salary);
}, "html");
})
})
</script>
</head>
<body>
<form runat="server">
<input type="button" value="GetSalary"/>
</form>
</body>
</html>
示例代码:点击下载
您可能感兴趣的文章: