日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

ajax傳遞多個(gè)參數(shù)具體實(shí)現(xiàn)_AJAX教程

編輯Tag賺U幣

推薦:ajax傳遞一個(gè)參數(shù)具體實(shí)現(xiàn)
ajax傳遞一個(gè)參數(shù)或多個(gè)參數(shù)在使用過(guò)程中由于特殊需求經(jīng)常會(huì)用到,下面與大家分享下具體的實(shí)現(xiàn)方法,感興趣的朋友可以參考下哈

復(fù)制代碼 代碼如下:hl5o.cn

<!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></title>
<script src="js/Jquery1.7.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#Button1').click(function () {
var username = $('#txtUserName').val();
var pwd = $('#txtPwd').val();
$.ajax({
type: "post",
contentType: "application/json",
url: "WebService1.asmx/Login",
data: "{username:'" + username + "',pwd:'" + pwd + "'}",
success: function (bukeyi) {
if (bukeyi.d == 'true') {
window.location = 'HTMLPage1.htm';
}
else {
$('#divinfo').text("用戶(hù)名或密碼錯(cuò)誤");
}
}
})
})
})
</script>
</head>
<body>
用戶(hù)名<input id="txtUserName" type="text" /><br />
密碼<input id="txtPwd" type="text" /><br />
<input id="Button1" type="button" value="登錄" /><br />
<div id="divinfo"></div>
</body>
</html>

------WebService1.asmx----
復(fù)制代碼 代碼如下:hl5o.cn

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace ajax11
{
/// <summary>
/// WebService1 的摘要說(shuō)明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允許使用 ASP.NET AJAX 從腳本中調(diào)用此 Web 服務(wù),請(qǐng)取消對(duì)下行的注釋。
[System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public string ValidateUser(string username)
{
if (username == "onlifes")
{
return "用戶(hù)名已被占用,請(qǐng)選擇其他";
}
else
{
return "可以使用,請(qǐng)繼續(xù)";
}
}
[WebMethod]
public string GetDate()
{
return DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
}
[WebMethod]
public string Login(string username, string pwd)
{
if (username == "admin" && pwd == "888888")
{
return "true";
}
else
{ return "false"; }
}
}
}

分享:滑輪滾動(dòng)到頁(yè)面底部ajax加載數(shù)據(jù)配合jsonp實(shí)現(xiàn)探討
滾動(dòng)下拉到頁(yè)面底部加載數(shù)據(jù)是很多瀑布流網(wǎng)站的做法,那來(lái)看看配合jsonp是如何實(shí)現(xiàn)的吧,小菜總結(jié)記錄之用特在此與大家一起分享,感興趣的朋友可以參考下哈

來(lái)源:模板無(wú)憂(yōu)//所屬分類(lèi):AJAX教程/更新時(shí)間:2013-05-22
相關(guān)AJAX教程