1. 程式人生 > >miniUI 中 json is error

miniUI 中 json is error

1.要確保你 server 端要返回的是 json 

        response.setCharacterEncoding("utf-8");
        response.setContentType("application/json;charset=utf-8");  

框架的話,有的可以直接轉.但是struts2,要注意返回null,不然的話,預設返回html頁面

2.json 的格式要和規定的一致

grid

{total:"",data:[{},{},{}]}

form

{}

格式一致,是沒有辦法顯示資料的

 

 

PS:

url,是請求資料的地址

.但是要是想回顯資料,別忘記也要再請求一次資料.