function CallMethod() { $.getJSON('/website/RESTfulService.svc/LiveLocation/json?{x=1,y=2}', function(data) { getResult(data.lat, data.lon); }); }
Pass them as an object just after the URL and before the function:
function CallMethod() { $.getJSON('/website/RESTfulService.svc/LiveLocation/json', { x: "1", y: "2" }, function(data) { getResult(data.lat, data.lon); }); }
Alternatively, first create javascript object for the sake of simplicity and then pass
var myObject = {x: "1", y: "2"}; $.getJSON('/website/RESTfulService.svc/LiveLocation/json', myObject, function(dataVal) { //Use Your result });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With