jquery 库最新版下载:jquery-1.4.2min.js
jquery 1.3.2mini版:jquery-1.3.2min.js
中文手册下载地址(超酷版):jquery12api
前台代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ajax.aspx.cs" Inherits="ajax" %>
<!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 Ajax实例</title>
<mce:script type="text/<a href="http://lib.csdn.net/base/javascript" class='replace_word' title="JavaScript知识库" target='_blank' style='color:#df3434; font-weight:bold;'>JavaScript</a>" src="script/jquery-142min.js" mce_src="script/jquery-142min.js"></mce:script>
<mce:script type="text/javascript"><!--
$(function() {
$("#dbtn").click(function(){
$.ajax({
type: "POST",
//dataType:"Text",
url:"Handler.ashx",
data:{name:"admin",pass:"admin"},
beforeSend:function(){
$("#ds").html("loading");
},
success: function(msg){
$("#ds").html("<p>"+msg+"</p><div class="aritcle_card flexRow">
<div class="artcardd flexRow">
<a class="aritcle_card_img" href="/xiazai/js/6180" title="jQuery滑块拖拽范围选择实例"><img
src="https://www.herecours.com/d/file/efpub/2026/21-21/20260221125250166802.jpg" alt="jQuery滑块拖拽范围选择实例" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a href="/xiazai/js/6180" title="jQuery滑块拖拽范围选择实例">jQuery滑块拖拽范围选择实例</a>
<p>jQuery ui插件制作实用的滑块左右拖拽数值区间范围选择,滑块拖动范围选择代码。</p>
</div>
<a href="/xiazai/js/6180" title="jQuery滑块拖拽范围选择实例" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
</div>
</div>");
}
});
});
});
// --></mce:script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="ds"><p>我是AJAX原来的文字!</p></div>
<input type="button" value="提交AJAX<a href="http://lib.csdn.net/base/softwaretest" class='replace_word' title="软件测试知识库" target='_blank' style='color:#df3434; font-weight:bold;'>测试</a>" id="dbtn" name="dbtn" />
</div>
</form>
</body>
</html>Handler.ashx:
<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
using System.Data.SqlClient;
public class Handler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
//context.Response.Write("Hello World");
if (context.Request["name"].ToString() == "admin" && context.Request["pass"].ToString() == "admin")
{
context.Response.Write("Y");
}
else
{
context.Response.Write("N");
}
}
public bool IsReusable
{
get
{
return false;
}
}
}更多Asp.net Jquery Ajax 实例关文章请关注PHP中文网!
