https://api.jquery.com/jquery.getjson/文件寫的很清楚,data是用$.parseJSON()解析response而來$.get、$.post這些都一樣是$.ajax的捷徑版,重點在dataType設為'json',不過預設的Intelligent Guess只要server有回適當的content-type header,也是會自動parseJSON你可以試看看$.get(url, function(data) {...}, 'text')和$.get(url, function(data) {...}, 'json') data是什麼型別server端的spring如果是@RestController/@ResponseBody,回傳值會經過HttpMessageConverter轉換,預設的有byte[] →application/octet-stream、String → text/plainResource → 看resource檔案種類其他各種物件 → application/json (看classpath上有哪個json library會有不同的預設converter)Map會變成JSON字串是因為有converter,String不會再轉換