私はRESTWebサービスをデプロイし、サービスは応答として文字列を返します。クロスドメインjQueryajaxリクエストを送信すると、「parsererror」が表示されます。
以下はSpringControllerです。
@RequestMapping(value="/TestService",method=RequestMethod.GET)
@ResponseBody
public String testServiceGet()
{
return "This is GET";
}
以下はjQueryajax()メソッドです。
$.ajax({
url: 'http://localhost:8080/Example_REST_WS_Deploy/service/TestService',
dataType: 'jsonp',
crossDomain: true,
contentType: 'text/plain',
success : function(data, textStatus, xhr) {
alert(data);
},
error : function(xhr, textStatus, errorThrown) {
alert("Error ->" + textStatus);
}
});
FFブラウザのエラーコンソールで受け取ったエラーは次のとおりです。
SyntexError: missing ; before statement
This is GET
-----^
できるだけ早く助けてください。