I am getting javascript error when I try to execute REST WCF Service from jsonp.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Timestamp: Thu, 7 Mar 2013 09:00:24 UTC
Message: Expected ';'
Line: 1
Char: 22
Code: 0
URI: https://google.com/ISCSOrderList/OrderListService.svc/RestService/GetOrderList?request=B36733DC-6DB5-4FB6-9A63-B25CE858CA28;FR;2010-06-27;2010-10-05&callback=jsonp1362646767878&_=1362646774807
I am using following code:
<script type="text/javascript">
function GetRestData() {
debugger;
var Guid = $('#txtUserGuid').val();
var CountryCode = $('#txtCountryCode').val();
var FromDate = $('#txtFromDate').val();
var ToDate = $('#txtToDate').val();
//jQuery.support.cors = true;
$.ajax({
url: "https://google.com/ISCSOrderList/OrderListService.svc/RestService/GetOrderList?request=B36733DC-6DB5-4FB6-9A63-B25CE858CA28;FR;2010-06-27;2010-10-05",
dataType: "jsonp",
type: "GET",
jsonpCallback: "MyCallback",
success: function(data, textStatus, jqXHR) {
alert(JSON.stringfy(data));
},
error: function(jqXHR, textStatus, errorThrown) {
alert(JSON.stringfy(errorThrown));
},
complete: function(jqXHR, textStatus) {
alert(JSON.stringfy(jqXHR));
}
});
}
function MyCallback(data) {
alert(JSON.stringfy(data));
}
</script>