response.setContentType("text/json");//设置为json类型JSONObject obj=new JSONObject();
  obj.put("name","foo");
  obj.put("num",new Integer(100));PrintWriter out = response.getWriter();
out.print(obj);前台我用$.getJSON('URL',function(data){
      alert(data);
     //弹出框里显示[object object]
});
但我用$.get('url',function(data){
      alert(data);
    //弹出框里显示{'name':'foo','num':100}
});
问题:怎样$.getJSON里也弹出{'name':'foo','num':100}呢?