jsonp callback error and parserror

Posted by Fatima Zahrae Abbadi on Stack Overflow See other posts from Stack Overflow or by Fatima Zahrae Abbadi
Published on 2014-08-21T16:14:46Z Indexed on 2014/08/21 16:20 UTC
Read the original article Hit count: 151

Filed under:
|

im devlopping web app with javascript/html5 client side and im using web service rest in the server i want to get json data from the server and i have problem of cross domain and i use JSONP the problme that i had the callback was not called this is the code of REST

@GET
@Path("agenda")
@Produces({MediaType.APPLICATION_JSON})
public List<AgendaChambre> getAgenda() {
    ArrayList<AgendaChambre>list=new ArrayList<>(); 
    return  agenda.findAll();
}

and

function getdata(){   
    $.ajax({
    type: "GET",
    dataType:"jsonp",
    crossDomain: true,
    url: "http://localhost:8080/wsccm/res/ws/agenda?jsoncallback=?",
    data: {name: "George Koch"},
    jsonpCallback: 'successCallback',
    success: function(data1) {
        getdata=JSON.stringify(data1);
        alert("bieeeeeeeeeeeeeeeeen");
        console.log("response:" + getdata);
    },
    error: function(jqXHR, textStatus, errorThrown) {
        alert('error'+errorThrown);
        console.log(jqXHR);
    }
}); 

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about JSON