you can pass it like that.. :)
data: "{'a':'"+No1+"','b':'"+No2+"'}",
see whole snippet.. :)
$(document).ready(function () {
$('#BtnRegister').click(function () {
debugger;
var No1 = document.getElementById('TxtFirstNumber').value;
var No2 = document.getElementById('TxtSecondNumber').value;
$.ajax({
cache: false,
type: "GET",
async: false,
url: "http://localhost:22727/Service1.svc/Display",
data: "{'a':'"+No1+"','b':'"+No2+"'}",
contentType: "application/json; charset=ytf-8",
dataType: "json",
processData: true,
success: function (result) {
alert("data");
},
error: function (xhr, textStatus, errorThrown) { alert(textStatus + ':' + errorThrown); }
});
});
});