注册 登录
编程论坛 jQuery论坛

jQuery get使用回调函数获取键值对

czg123698741 发布于 2010-09-02 00:07, 2967 次点击
大家好,如题,请帮帮忙~~~~~~~

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值
          });
    });
}
0 回复
1