ajax传参方式

方式一

function orderCancel(orderId, commant){  
    var flag = false;  
    $.ajax({  
        type: "POST",  
        url: "../order/orderCancel.action", //orderModifyStatus  
        data: {"orderId":orderId,"commant":commant},  
        dataType:"json",  
        async:false,  
        cache:false,  
        success: function(data){  
            var member = eval("("+data+")"); //包数据解析为json 格式                                                            
            if(member.success=="true"){  
                flag = true;  
            }else if(member.success=="false") {  
                alert(member.info);  
            }  
        },  
        error: function(json){  
            alert("订单取消异常,请刷新后重试...");  
        }  
    });  
    hidediv();  
    return flag;  
}  

方式二

data: "orderId=" + orderId + "&commant=" + commant
posted @ 2017-10-19 10:31  hptjzzj  阅读(479)  评论(0编辑  收藏  举报