0

I am trying to make a simple ajax request(cross-domain) using Json.

Here's my code :

    $("#unsub").live('click', function() {
    $.ajax({ 
    url: urly ,
    type:'GET',
    dataType:"json", //type JSON
    success: function(data) { //do something
    }

    });

    });

However, the response I am getting from the server is a html Div

    <div id="handler"></div>

On button click I get an error on success "XML can't be the whole program". Please note : i have to USE json to make the call no matter what and the call will always return a div. using jquery 1.3.2

Any help would be highly appreciated.

Thanks for the time.

ragsonWeb
  • 25
  • 5

1 Answers1

0

Most of the time you need to provide the remote server a "callback" in url for the jsonp to be wrapped in. If API is not set up for JSONP, you need to use other methods to egt the JSOn with javascript. First check that API will deliver jsonp, and if so what params to put in the url

charlietfl
  • 170,828
  • 13
  • 121
  • 150