2017-05-31 11 views
0

私はjQueryを使ってAjaxのGETリクエストを送信しようとしていますが、私はこのエラーを取得しています:jQueryのAjaxの入手はTypeError:不正な呼び出し

Uncaught TypeError: Illegal invocation at e (jquery.min.js:4) at dc (jquery.min.js:4) at dc (jquery.min.js:4) at Function.n.param (jquery.min.js:4) at Function.ajax (jquery.min.js:4) at home.js:2

var cid = document.getElementById("id").value; 
$.ajax({ 
    type : "GET", 
    url : windowLocationS + "findTourByCustomId", 
    data : { 
     id : cid 
    }, 
    async : false, 
    cache : false, 
    dataType : "json", 
    contentType: "application/json", 
    success : function(jsn) { 
     console.log(jsn.length); 
    }, 
    error : function(error) { 
     console.log(error); 
    } 
}); 

コントローラー:

@RequestMapping(value= "/findTourByCustomId", method = RequestMethod.GET, headers = "Accept=application/json") 
    public List<classA> findTourByCustomId(@RequestParam(value = "id", required = true) String id) { 
     return service.findByCustomId(id); 
    } 

がどのように私ができるのデータを正常に取得できますか?

+0

あなたの疑問にお答えしたjsコードスニペットはあなたの 'home.js'ファイルですか? – eeya

+0

@eeyaはい、コードスニペットが 'home.js'にあります –

+0

もしあなたが質問を更新し、'

関連する問題