//调用WebService 带参数与不带参数,这里参数名必须与WebService中的参数名相同
<script type="text/javascript">
function getName() {
$.ajax({
type: "post",
url: "http://192.168.1.125/WebServiceTest/WebService.asmx/GetName",
data: { strName: 'gs' },
success: function (data) {
alert(data.text);
}
});
}
function helloWorld() {
$.ajax({
type: "post",
url: "http://192.168.1.125/WebServiceTest/WebService.asmx/HelloWorld",
success: function (data) {
alert(data.text);
}
});
}
</script>