Do you know why it does not show the result in chrome? But it shows on IE 9?
I am able to see the response data shown in google chrome (F12)
An exact error it shown
XMLHttpRequest cannot load
http://clientaccesstest.usa.com/wcf/proquotes/RestService/QuoteService/GetNetPrice(066,335281,[AAS3602I],[1],1,SA7)?_=1
4286853123
96.
No 'Access-Control-Allow-Orig
in' header is present on the requested resource. Origin '
http://localhost:62937' is therefore not allowed access.
The result should be in xml format from wcf services.
#region GetNetPrice
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "QuoteService/GetNetPrice(
{CompanyID
},{Custome
rNo},{Mode
l},{Qty},{
OrderDate}
,{RepNo})"
)]
String GetNetPrice(string CompanyID, string CustomerNo, string Model, string Qty, string OrderDate, string RepNo);
#endregion
<script type="text/javascript">
function GetNetPrice() {
var GetNetPriceJSon = "
http://clientaccesstest.usa.com/wcf/orders/RestService/QuoteService/GetNetPrice";
//url: GetNetPriceJSon + encodeURIComponent("(066,3
35281,[AAS
3602I],[1]
,1,SA7)"),
//var GetNetPriceJSon = "
http://clientaccesstest.usa.com/wcf/orders/RestService/QuoteService/GetNetPrice(066,335281,[AAS3602I],[1],1,SA7)";
var companyID = "066";
var dealerNo = "335281";
var modelNo = "[AAS3602I]";
var qty = "[1]";
var orderDate = "1";
var repNo = "SA7";
var allInfo = "(" + companyID + "," + dealerNo + "," + modelNo + "," + qty + "," + orderDate + "," + repNo + ")";
$(document).ready(function
() {
$.ajax({
crossDomain: true,
cache: false,
type: "GET",
async: false,
dataType: "text/xml; charset=utf-8", // result: get this data type from the server
contentType: "text/plain", //send to the server //text/plain
url: GetNetPriceJSon + allInfo,
success: function (data) {
alert("Success: Data Below:" + data);
resultObj = jQuery.parseJSON(data);
},
error: function (xhr, status, error) {
//alert(xhr.responseText + " : Error GetNetPriceJSon");
}
});
});
}
</script>