2

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>
3
  • If I drop your code into a fiddle I get a rather different error. "503 Service Unavailable" - jsfiddle.net/HQaPS Commented Mar 11, 2013 at 6:16
  • @Snixtor : You are right because i have shared you a dummy url , not the exact one.I cannot share the exact urls for security reasons. Commented Mar 11, 2013 at 6:47
  • 1
    ahm did you try put semicolon on the uri ? ;2010-10-05 make it like this ;2010-10-05; Commented Mar 15, 2013 at 13:32

1 Answer 1

1

OP,

The issue that you're having is likely related to an error in your actual URL/resource. Unless we can replicate the error, we can't help you solve it. Providing code with a request to a URL which 503's won't get us anywhere, and is confusing.

Can you clone a piece of your private resource and insert dummy data where the sensitive information is?

Alternatively, can you copy and paste what you find if you look at your resource on Line: 1 Char: 22 ? Maybe a few lines before and after to be safe.

Sign up to request clarification or add additional context in comments.

2 Comments

While I don't agree that this should have been posted as an answer (it's a comment), I agree with the sentiment. This question would get much more attention were the issue presented in a more easily replicable manner.
@Snixtor you commented in response to the 503 and OP didn't seem to understand. Rather than add to the comment thread I opted to post an answer with the hopes of updating/editing it once OP realized the information provided was insufficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.