Saturday, 16 March 2013
Call WCF webservice with Parameter for PhoneGap by Jquery
//Call Webservice on Singin Guest
var MyData = '{"GuestFirstName":"' + $('#txtFirstName').val().toString()
+ '","GuestLastName":"' + $('#txtLastName').val().toString()
+ '","GuestCompany":"'
$('#txtCompanyName').val().toString()
+ '","GuestCarNo":"' + $('#txtCarNumber').val().toString()
+ '","MeetingPurpose":"' + $('#txtHereToMeet').val()+ '"}';
url = VisitorServiceUrl + "InsertGuestDetails";
try {
$.support.cors = true;
$.ajax({
type: 'POST',
//URL
url: url,
// Parameter
data: MyData,
contentType: 'application/json; charset=UTF-8',
dataType: 'json',
beforeSend: function () {
// alert("Processing...");
},
success: function (data) {
alert('You have Signed In Successfully.');
location.reload();
},
error: function (xhr, ajaxOptions, thrownError) {
alert('error InsertGuestDetails : ' + thrownError);
}
});
}
catch (e) {
alert(e.Message);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment