I'm using jQuery $.ajax to make a cross-domain jsonp call to a WCF
service.  The call is working fine, entering the service endpoint, but
the callback method never fires.  I've tried many permutations of
changes and can't seem to get this to work.

The WCF endpoint is returning a string (NOT doing a Response.Write)
that contains a json object inside the callback wrapper (e.g.
"jsonp123( {"Author":"John Doe","Price":"$35.90"} )" ) and the content-
type returned from the service is application/json; charset=utf-8.

$.ajax call is below.  Any help is much appreciated.

        var data = {"ISBN" : $("#isbn1").val()};

        $.ajax({
                type: "GET",
                cache: false,
                url: "http://localhost:63132/Widget.svc/GetProductInfo";,
                scriptCharset: "utf-8",
                dataType: "jsonp",
                data: data,
                success: function(data, textStatus){
                        alert("success");
                },
                error: function(XMLHttpRequest, textStatus, errorThrown){
                        alert('error');
                }
        });

Reply via email to