$.ajax({ url:"http://192.168.100.47:8080/ais-connect/data/newaisSyn",type:‘GET‘,dataType:‘JSONP‘,jsonp: ‘callback‘,success: function(data){ var myshipids=data; console.log(data); $.each(data,function(i,obj){ console.log(obj.MMSI); }) @H_404_20@//@H_404_20@ console.log(123); },error: function(jqXHR,textStatus,errorThrown ){ console.log(textStatus); console.log(errorThrown); } }); public void newaisSyn() throws IOException{ HttpServletRequest request = getRequest(); HttpServletResponse response = getResponse(); response.setHeader("Access-Control-Allow-Origin","*"); @H_404_20@//@H_404_20@ response.setCharacterEncoding("UTF-8"); @H_404_20@//@H_404_20@ Writer out = response.getWriter(); @H_404_20@//@H_404_20@ System.out.println("dsds"); @H_404_20@//@H_404_20@ out.write("dsds"); List<Record> list = Db.use("ais").find("SELECT d.mmsi FROM T_SHIP_TRACK_RECENT d where rownum<=10"); String callback = request.getParameter("callback"); System.out.println("callback(" + JsonKit.toJson(list) + ")"); @H_404_20@//@H_404_20@ renderJson("callback(" + JsonKit.toJson(list) + ")"); renderJson(String.format("%s(%s)",callback,JsonKit.toJson(list))); }