jQuery get使用回调函数获取键值对
大家好,如题,请帮帮忙~~~~~~~servlet:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out = response.getWriter();
String id=request.getParameter("ID");
out.print("{myid:'fds',result:true}");
}
JS:
function DelGoods(trId,gId){
$(document).ready(function(){
var $trid=$(trId);
var $gid=$(gId);
$.get("CarDelServlet", { ID: "12121212"},
function(data,textStatus){
alert(data);
//我现在想分别输出myid 和 result 的JSON值
});
});
}