问题1,使用jquery的好处?
问题2,下面的代码是什么意思,submit:function(v,m,f)中的三个参数是什么意思?它与buttons:{确定:true,取消:false}有什么关系。
问题3,$.ImpromptuClose()是什么意思?
问题4,$.prompt是什么意思?
问题5,var listEmployeeForm=$("#listEmployee");是什么意思?
问题6,$.ajax({url:"employeeDispatcherAction!haveClusterOwner.portal?userids="+x,这行中有个!感叹号是什么意思。 
部分代码如下:
                             $.prompt(txt_3,{
buttons:{确定:true,取消:false},
submit:function(v,m,f){
if(v){
var haveOwnerMsg="是否继续?";
                        var rs;
                        $.ajax({url:"employeeDispatcherAction!haveClusterOwner.portal?userids="+x,
                                async:false,
                                success:function(data){
                                    if(data == 'true'){
                                        rs = true;
                                    }else{
                                        rs = false;
                                    }
                                }});
                        if(rs){
                            //have owner
                            $.ImpromptuClose();
                            $.prompt(haveOwnerMsg,{
                                buttons:{确定:true,取消:false},
                                submit:function(v,m,f){
                                    if(v){
                                        //delete
                                        var listEmployeeForm=$("#listEmployee");
                                        listEmployeeForm.attr("action", "employeeDispatcherAction!deleteDeptInput.portal?isListByEmployeePageInfo=1");
                                        listEmployeeForm.submit();
                                        $.ImpromptuClose();
                                    }else{
                                     $.ImpromptuClose();
                                    }
                                }
                            });
                        }else{
                            //no owner ,delete
                            //delete
                            var listEmployeeForm=$("#listEmployee");
                            listEmployeeForm.attr("action", "employeeDispatcherAction!deleteDeptInput.portal?isListByEmployeePageInfo=1");
                            listEmployeeForm.submit();
                            $.ImpromptuClose();
                        }
}else{
jQuery.ImpromptuClose();
return false;
}
}
});
}

解决方案 »

  1.   

    jQuery的好处很多,跨浏览器,简化文档遍历、事件处理、动画和Ajax,http://trentrichardson.com/Impromptu/index.php
    因该是你用的这个插件($.prompt)的官网,上面介绍的很清楚了$("#listEmployee")这个是选择器这里是找出id为listEmployee的元素
    参考: http://docs.jquery.com/Selectors
      

  2.   

    jQuery 写更少的代码做更多的事情,
    http://bbs.jquery.org.cn/
    jQuery  插件恶多,有时候蛮晕的。
      

  3.   

    $.prompt(txt_3,{buttons:{确定:true,取消:false},)
    弹出一个提示框,上面有确定和取消两个按钮
      

  4.   

    submit:function(v,m,f)中的三个参数是什么意思?
      

  5.   

    LZ你不看说明的吗
    submit:function(v,m,f)
    The callback function has three parameters.
    The first is the value of the button clicked. 
    The second is a jQuery object of the message within the active state when the user clicked the button. 
    The third is an object of key/value pairs of the form values. The keys are the name attribute for the form element.