<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(function () {
$("#bt1").click(function () {
$.ajax({
type: "post",
url: "WebService.asmx/HelloWorld",
success: function (response) {
alert($(response).find("string").text());
}
});
}
);
})
</script>
---------------------------------- WebService.asmx
[WebMethod]
public string HelloWorld() {
return "Hello World";
}