- PhoneGap plist: Can External host be set to ip address?
- function GetEstimate(From, To) {
- "use strict";
- varType = "GET";
- varUrl = "http://xx.xxx.xxx.xx/service.svc/" +
- "GetBasicEst?pickupPostalCode="+ From + "&dropoffPostalCode="+ To +"";
- varContentType = "application/json; charset=utf-8";
- varDataType = "jsonp";
- varProcessData = true;
- alert("GetEstimate");
- new CallService();}
- function CallService(){
- alert("Inside Call Service");
- "use strict";
- $.ajax({
- type : varType, //GET or POST or PUT or DELETE verb
- url : varUrl, // Location of the service
- data : varData, //Data sent to server
- contentType : varContentType, // content type sent to server
- dataType : varDataType, //Expected data format from server
- processdata : varProcessData, //True or False
- success : function(data) {//On Successfull service call
- alert("Success");
- var innerHtml = "";
- var rhigh=data.EstimateHigh;
- var rlow=data.EstimateLow;
- alert(rlow);
- $("#rHigh").html(rhigh);
- $("#rLow").html(rlow);
- $("#rHigh").formatCurrency();
- $("#rLow").formatCurrency();
- },
- //error: ServiceFailed // When Service call fails
- });}
- function GetEstimate(From, To) {
- "use strict";
- varType = "GET";
- varUrl = "http://xx.xxx.xxx.xx/service.svc/GetBasicEst";
- // YOUR DATA
- varData = "pickupPostalCode="+ From + "&dropoffPostalCode="+ To;
- varContentType = "application/json; charset=utf-8";
- varDataType = "jsonp";
- varProcessData = true;
- alert("GetEstimate");
- new CallService();}
- function CallService(){
- alert("Inside Call Service");
- "use strict";
- $.ajax({
- type : varType, //GET or POST or PUT or DELETE verb
- url : varUrl, // Location of the service
- data : varData, //Data sent to server
- contentType : varContentType, // content type sent to server
- dataType : varDataType, //Expected data format from server
- processdata : varProcessData, //True or False
- success : function(data) {//On Successfull service call
- alert("Success");
- var innerHtml = "";
- var rhigh=data.EstimateHigh;
- var rlow=data.EstimateLow;
- alert(rlow);
- $("#rHigh").html(rhigh);
- $("#rLow").html(rlow);
- $("#rHigh").formatCurrency();
- $("#rLow").formatCurrency();
- },
- //error: ServiceFailed // When Service call fails
- });}