日期:2014-05-16  浏览次数:20407 次

Struts2,AJAX,json-plugin使用
2009-06-05
Struts2,AJAX,json-plugin使用

    博客分类:
    AJAX

jsonAjaxStrutsjQuerySpring

代码请参照http://acheron.iteye.com/admin/blogs/402499



JSON官方文档

http://www.json.org/json-zh.html



jQuery官方文档

http://docs.jquery.com/Main_Page


Js代码  收藏代码

    <span style="font-size: small;">function removerecordbyid(recordid){  
            $("#showallrecord table tr").each( 
            function(){ 
              var seq=parseInt($(this).children("td").html()); 
              var thisrecord = this; 
              if(seq==recordid) 
                if(confirm("您确认执行删除操作么?")){ 
                    $.ajax({ 
                        type: "POST", 
                        url:"removeRecordById.action", 
                        dataType:"json", 
                        data:{"msg.id":recordid}, 
                        success:function(json){ 
                            if(json.status==4){ 
                                alert("删除失败,只有提交留言的ip才能删除"); 
                            }else{ 
                                $(thisrecord).remove(); 
    //                          alert("删除成功");   
                            } 
                        }, 
                        error:function(){ 
                            alert("del error"); 
 &nb