js 中$.ajax 以及$.post 写法

来源:互联网 发布:java 执行字符串代码 编辑:程序博客网 时间:2024/06/06 07:39
 $.ajax(
                                       {
                                       url:"authority/role!check.action",
                                       async:false,
                                       data:"id="+id,
                                        success: function(data){
                                            alert("data"+data.flag);
                                            if(data.flag=="1"){
                                                alert("不能修改自己的角色信息");
                                                returnValue="1";
                                       }
                                        },
                                        dataType:"json"

                                       });


$.post("authority/role!check.action", {
                                        id : id
                                    }, function(dialogHtml) {
                                        
                                        if(dialogHtml.flag=="1"){
                                            alert("不能修改自己的角色信息");
                                            returnValue="1";
                                        }
                                    },"json");




0 0
原创粉丝点击