如何在调用webservice时调用jquery中的远程服务器url? [英] how to call remote server url in jquery while calling webservice?
本文介绍了如何在调用webservice时调用jquery中的远程服务器url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
function saveData() {
var txtName = $("#txtName").val();
var txtEmailId = $("#txtEmailId").val();
var txtPwd = $("#txtPwd").val();
var txtPhoneNo = $("#txtPhoneNo").val();
$.ajax({
type: "POST",
url: "http://microsoft.com/webserviceswithdatabase/saveData",
data: "{Name:'" + txtName + "',Password:'" + txtPwd + "',EmailID:'" + txtEmailId + "',PhoneNo:'" + txtPhoneNo + "'}",
contentType: "application/json; charset=utf-8",
datatype: "jsondata",
async: "true",
success: function (response) {
// $(".errMsg ul").remove();
var myObject = eval('(' + response.d + ')');
if (myObject > 0) {
// bindData();
alert(" saved successfully");
}
else {
alert("Opppps something went wrong.");
}
// $(".errMsg").show("slow");
clear();
},
error: function (response) {
alert(response.status + ' ' + response.statusText);
}
});
}
当我运行此代码时,我收到0错误消息。那么请告诉我如何解决这个问题?
when i run this code, i got 0 error message. So please tell me how to solve this?
推荐答案
( #txtName跨度>)VAL();
var txtEmailId =
("#txtName").val(); var txtEmailId =
( #txtEmailId跨度>)VAL();
var txtPwd =
("#txtEmailId").val(); var txtPwd =
( #txtPwd跨度>)VAL();
var txtPhoneNo =
("#txtPwd").val(); var txtPhoneNo =
这篇关于如何在调用webservice时调用jquery中的远程服务器url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文