js顺序

<scripttype="text/javascript">

       $(function () {

           var html = "<input type='text' id='inputReason'style='width:280px; height:100px; resize: none;border:none;margin:5px'/>";

var value=$("#inputReason").val();

           $("#btnRebut").click(function () {

//               jBox.open("iframe:http://www.baidu.com", "百度一下",800, 350);

//                jBox.open(html, '驳回原因', 300,200);

                $.jBox(html, {

                    title: "驳回原因",

                    width: 300,

                    height: 200,

                    buttons: {"提交":'ok', "取消": 'cancel'},

                    buttonsFocus: 'ok',

                    submit: function (v, h, f){

                        if (v =="ok") {

                            console.log(value);

//                            name = f.name;

//                            phone = f.phone;

//                            address =f.address;

//                            desc = f.desc;

                            $.post(url, /*{

                            "jBox.name": name,

                            "jBox.phone": phone,

                            "jBox.address": address,

                            "jBox.desc": desc

                             }, */function(data, status) {

                                if("success" == status) {

                                   $.jBox.success("Data Transufal success!","success");

                                   parent.location.reload();

                                } else {

                                   $.jBox.error("Error Transufal", "Error");

                                    returnfalse;

                                }

                            });

                        }

                        if (v == "cancel"){

                            alert("已取消!");

                            return true;

                        }

                    }

                });

           });

       });

   </script>




<scripttype="text/javascript">

       $(function () {

           var html = "<input type='text' id='inputReason'style='width:280px; height:100px; resize: none;border:none;margin:5px'/>";

           $("#btnRebut").click(function () {

//               jBox.open("iframe:http://www.baidu.com", "百度一下",800, 350);

//                jBox.open(html, '驳回原因', 300,200);

                $.jBox(html, {

                    title: "驳回原因",

                    width: 300,

                    height: 200,

                    buttons: {"提交":'ok', "取消": 'cancel'},

                    buttonsFocus: 'ok',

                    submit: function (v, h, f){

                        var value=$("#inputReason").val();

                        if (v =="ok") {

                            console.log(value);

//                            name = f.name;

//                            phone = f.phone;

//                            address =f.address;

//                            desc = f.desc;

                            $.post(url, /*{

                            "jBox.name": name,

                            "jBox.phone": phone,

                            "jBox.address": address,

                            "jBox.desc": desc

                             }, */function(data, status) {

                                if("success" == status) {

                                   $.jBox.success("Data Transufal success!","success");

                                   parent.location.reload();

                                } else {

                                   $.jBox.error("Error Transufal", "Error");

                                    returnfalse;

                                }

                            });

                        }

                        if (v == "cancel"){

                            alert("已取消!");

                            return true;

                        }

                    }

                });

           });

       });

   </script>



标红的两句代码的位置不同导致输出的结果不同,记录一下,要注意顺序!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值