title: AJAX JSONP with Jersey / JAX-RS Restful service
body: <p>I've read a lot of questions on stackoverflow but i've not got solution to my problem.</p>
  
  <p>This is my Restful service:</p>
  
  <pre><code>@GET
  @Path("/GetAllProducts")
  @Produces(MediaType.APPLICATION_JSON)
  public String getAllProducts() {        
      return  "{\"name\":\"MAC\", \"quantity\":\"10\"}";
  }
  </code></pre>
  
  <p>It works fine on browser but when i used AJAX, it didn't display errors but showed a popup: Failed object[Object]</p>
  
  <p>And my AJAX code:</p>
  
  <pre><code>$.ajax({
      url: "http://localhost:8080/Restful/REST/WebService/GetAllProducts",
      type: 'GET',
      contentType: "application/json; charset=utf-8",
      dataType: "jsonp",
      success: function() { 
          alert("Success"); 
      },
      error: function(e) { 
          alert('Failed! ' + e); 
      }
  });
  </code></pre>
  
  <p>I tried to add: "crossDomain: true" but it didn't work.</p>
  
  <p>Please help me! Thanks!</p>