引入json.js
下載地址:https://github.com/douglascrockford/JSON-js
JSON.stringify(obj);
在Controller中,
1.response.setContentType("application/json");
則當返回boolean+""時,前臺會獲得boolean類型的數據
2.response.setContentType("application/text");
則當返回boolean+""時,前臺會獲得string類型的數據