jQuery dialog 异步调用ashx,webservice数据的代码

2020-05-22 16:43:47易采站长站整理

});
}
});
}
//返回dataset
function ajax6()
{
$.ajax({
type: “post”,
url: “action/WebService.asmx/GetDataSet”,
data: “{}”,
datatype:”xml”,
success: function(msg) {
$(msg).find(‘Table1’).each(function() {
alert($(this).find(“ID”).text()+’___’+$(this).find(“Value”).text());
});
}
});
}
</script>
<form id=”form1″ runat=”server”>
<input id=”dialog_link” type=”button” value=”Show” onclick=”show()” />
<div id=”dialog” style=”display: none; background-color: Aqua; width: 200px; height: 150px;”>
WebService参数1<input type=”text” id=”txtMsg1″ /><br/>
WebService参数2<input type=”text” id=”txtMsg2″ /><br/>
<input type=”button” value=”调用Ashx一般处理程序” onclick=”ajax1()” id=”btn1″ />
<input type=”button” value=”调用无参数WebService” onclick=”ajax2()” id=”btn2″ />
<input type=”button” value=”调用有参数WebService” onclick=”ajax3(txtMsg1.value,txtMsg2.value)” id=”btn3″ />
<input type=”button” value=”调用返回集合的WebService” onclick=”ajax4()” id=”btn4″ />
<input type=”button” value=”调用返回复合类型的WebService” onclick=”ajax5()” id=”btn5″ />
<input type=”button” value=”调用返回DataSet的WebService” onclick=”ajax6()” id=”btn6″ />
<div id=”dictionary”></div>
In Dialog!
</div>
</form>
</body>
</html>

作者博客:http://www.cnblogs.com/qixuejia/