Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

asp.net, jquery

Does it looks right to you? url: GetSaleTax + encodeURIComponent("(066,337557," + city + "," + state + "," + zip + ",USA)"),
Below codes working in IE, but not Chrome/firefox.

Need helps to find out why and how to fix it?


wcf: template:
 #region GetSaleTax
        [OperationContract]
        [WebGet(UriTemplate = "QuoteService/GetSaleTax({CompanyID},{CustomerNo},{ShipToCity},{ShipToState},{ShipToZip},{ShipToCountry})")]
        String GetSaleTax(string CompanyID, string CustomerNo, string ShipToCity, string ShipToState, string ShipToZip, string ShipToCountry);
        #endregion


jquery call:
<script type="text/javascript">
    function GetSaleTaxList(city, state, zip) {

        city = "COLUMBUS";
        state = "IN";
        zip = "47201";
        var str = "(066,337557,COLUMBUS,IN,47201,USA)";
         
        var GetSaleTax = "http://clientaccesstest.abcusa.com/wcf/orders/RestService/QuoteService/GetSaleTax";            
            if (city == '' || state == '' || zip == '' ) {
                  //setSaleTaxInfo("NO RATE");
            }else if (state == 'XX') {
                  //setSaleTaxInfo("NO RATE");
            }else{
                  $(document).ready(function () {
                              
                        //alert(GetSaleTax);
                        $.ajax({
                              cache: false,
                              type: "GET",
                              async: false,
                              dataType: "json",
                              contentType: 'text/plain',
                              //url: GetSaleTax + encodeURIComponent("(" + 066, '' + "," + city + "," + state + "," + zip + "," + USA + ")"),
                               url: GetSaleTax + encodeURIComponent("(066,337557," + city + "," + state + "," + zip + ",USA)"),
                               processData:true,                        
                    // [WebGet(UriTemplate = "QuoteService/GetSaleTax({CompanyID},{CustomerNo},{ShipToCity},{ShipToState},{ShipToZip},{ShipToCountry})")]
       
                              success: function (data) {
                                    //$('#data').html(data);
                                    alert(data + " : data");
                                    if (data == null)
                                          return;
                                    //setSaleTaxInfo(data);
                                    //resultObj = jQuery.parseJSON(data);
                                    //if (resultObj.Status != 'Failed') {
                                    //    $('#json').html(setSaleTaxInfo(resultObj.Data));
                                    //}
                              },
                              error: function (xhr) {
                                    //$('#data').html(xhr.responseText);
                                    alert(xhr.responseText + " : error GetSaleTax");

                              }
                        });
                  });
            }
}
</script>
Avatar of ambience
ambience
Flag of Pakistan image

This is likely a duplicate of https://www.experts-exchange.com/questions/28651592/wcf-asp-net-jquery-ajax-restful.html?cid=1752

You should keep one question and continue posting comments until you get a resolution.
ASKER CERTIFIED SOLUTION
Avatar of ambience
ambience
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITsolutionWizard

ASKER

please take a look attachment.
error8.jpg
ambience: Please let me know if you can help....Thanks