$(".gopay").click(function(){
if(jsons!=""){
var index = parent.layer.load(2, {shade:0.3,time: 100*10000});
$.ajax({
type: "get",
url:ctx+"/order/orderInfo/toPayCheck",
data:{data:JSON.stringify(json)},
dataType:"json",
error: function(XMLHttpRequest, textStatus, errorThrown) {
if(XMLHttpRequest.responseText){
parent.layer.close(index);
parent.layer.alert(XMLHttpRequest.responseText, {icon: 2});
}
else{
parent.layer.close(index);
parent.layer.alert("", {icon: 2});
}
},
success: function(data) {
var msg=data;
if(msg.code==0000){
//
parent.layer.close(index);
submitform();
}
else{
parent.layer.close(index);
parent.layer.alert(msg.message, {icon: 2});
}
}
});
}
})
function submitform(){
$(".money").val(jsons.sumPay);
$(".orderNo").val(jsons.No);
$(".orderIds").val(ids);
$("-sharphiddenform").submit();
console.log(1)
};
<form action="${ctx}/order/orderInfo/toPay" method="post" id="hiddenform" target="_blank" >
<input type="hidden" name="money" class="money">
<input type="hidden" name="orderNo" class="orderNo">
<input type="hidden" name="orderIds" class="orderIds ">
</form>
if you want to submit the form after the ajax is successful, you can"t submit it.