Javascript 在新窗口中过帐会产生空白页(jquery)
试图发布到一个新窗口,但新窗口打开,但给我一个空白页 在alignet.js中Javascript 在新窗口中过帐会产生空白页(jquery),javascript,jquery,post,Javascript,Jquery,Post,试图发布到一个新窗口,但新窗口打开,但给我一个空白页 在alignet.js中 //first_step $('form').submit(function(){ return false; }); $('#submit_first').click(function(){ //remove classes $('#first_step input').removeClass('error').removeClass('valid'); //ckeck if inputs
//first_step
$('form').submit(function(){ return false; });
$('#submit_first').click(function(){
//remove classes
$('#first_step input').removeClass('error').removeClass('valid');
//ckeck if inputs aren't empty
//var fields = $('#first_step input[type=text]');
var error = 0;
$( ':input[type=text]', '#first_step').each( function () {
if ( this.value.trim() == false ) {
$(this).addClass('error');
error++;
}
});
if(!error) {
//update progress bar
$('#progress_text').html('50% Complete');
$('#progress').css('width','113px');
//slide steps
$('#first_step').slideUp();
dataString = $("#first_step input").serialize();
//alert(dataString);
$.ajax({
type: "POST",
url: "../../wp-content/plugins/oci-alignet/process.php",
data: dataString,
success: function(data) {
var alignet_encrypted = jQuery.parseJSON(data);
$("input[name=XMLREQ]").val(alignet_encrypted.XMLREQ);
$("input[name=SESSIONKEY]").val(alignet_encrypted.SESSIONKEY);
$("input[name=DIGITALSIGN]").val(alignet_encrypted.DIGITALSIGN);
}
},
"json");
$('#second_step').slideDown();
} else return false;
});
在php中生成
$html = '<!-- #first_step -->
<div id="first_step">
<h1>Informacion General</h1>
<h5>Recuerden que SITENAME no pide numero de tarjeta ni su cuenta Bancario</h5>
<div class="form">
<label for="purchaseCommerceAmount">Valor (USD):</label>
<input type="text" name="purchaseCommerceAmount" id="purchaseCommerceAmount" value="20.00" />
<label for="billingFirstName">Nombre del tarjetahabiente. (como aparece en la tarjeta de crédito):</label>
<input type="text" name="billingFirstName" id="billingFirstName" value="" />
<label for="billingLastName">Apellido del tarjetahabiente. (como aparece en la tarjeta de crédito) :</label>
<input type="text" name="billingLastName" id="billingLastName" value="" />
<label for="billingEMail">Dirección electrónica del tarjetahabiente.:</label>
<input type="text" name="billingEMail" id="billingEMail" value="" />
<label for="billingAddress">Dirección del tarjetahabiente:</label>
<input type="text" name="billingAddress" id="billingAddress" value="" />
<label for="billingZIP">Código Postal del tarjetahabiente:</label>
<input type="text" name="billingZIP" id="billingZIP" value="XX000" />
<label for="billingCity">Nombre de la ciudad del tarjetahabiente:</label>
<input type="text" name="billingCity" id="billingCity" value="" />
<label for="billingState">Nombre del estado del tarjetahabiente:</label>
<input type="text" name="billingState" id="billingState" value="" />
<label for="billingCountry">Código (eg: EC,BR,AR) del país del tarjetahabiente:</label>
<input type="text" name="billingCountry" id="billingCountry" value="EC" />
<label for="billingPhone">Teléfono del tarjetahabiente:</label>
<input type="text" name="billingPhone" id="billingPhone" value="" />
<label for="shippingFirstName">Nombre de la persona que recibirá los bienes:</label>
<input type="text" name="billingFirstName" id="billingFirstName" value="" />
<label for="shippingLastName">Apellido del tarjetahabiente. (como aparece en la tarjeta de crédito) :</label>
<input type="text" name="billingLastName" id="billingLastName" value="" />
<label for="shippingEMail">Email de la persona que recibirá los bienes:</label>
<input type="text" name="shippingEMail" id="shippingEMail" value="" />
<label for="shippingAddress">Dirección de entrega del pedido del tarjetahabiente:</label>
<input type="text" name="shippingAddress" id="shippingAddress" value="" />
</div>
<!-- clearfix -->
<div class="clear">
</div>
<!-- /clearfix -->
<input class="submit" type="submit" name="submit_first" id="submit_first" value="Continuar" />
</div>
<!-- #second_step -->
<form id="second" method="POST" action="https://test2.alignetsac.com/VPOS/MM/transactionStart20.do" target="foo" onSubmit="window.open(\'\', \'foo\', \'width=450,height=300,status=yes,resizable=yes,scrollbars=yes\')">
<div id="second_step">
<h2>DATA COMPILED READY TO SEND</h2>
<div class="form">
<label for="XMLREQ">XMLREQ</label>
<input type="text" name="XMLREQ" id="XMLREQ" value="" />
<label for="DIGITALSIGN">DIGITALSIGN</label>
<input type="text" name="DIGITALSIGN" id="DIGITALSIGN" value="" />
<label for="SESSIONKEY">SESSIONKEY</label>
<input type="text" name="SESSIONKEY" id="SESSIONKEY" value="" />
<lable for"URLVPOS">URLVPOS</label>
<select name="URLVPOS" id="URLVPOS">
<option value="https://test2.alignetsac.com/VPOS/MM/transactionStart20.do">preprod.verifika.com</option>
</select>
</div>
<!-- clearfix --><div class="clear"></div><!-- /clearfix -->
<input class="submit" type="submit" name="submit_second" value="Send" />
<!-- clearfix --><div class="clear"></div><!-- /clearfix -->
</div>
</form>
<div id="progress_bar">
<div id="progress"></div>
<div id="progress_text">0% Complete</div>
</div>';
return $html;
$html='1!'
一般信息
场地名称不包括场地编号
价值(美元):
名字是tarjetahabiente。(科莫·阿帕雷塞·恩拉塔·德克雷迪托):
阿佩利多·德尔·塔吉塔哈比恩特。(科莫·阿帕雷塞·恩拉塔·德克雷迪托):
塔吉塔哈比恩特电力公司:
塔吉塔哈比恩特郡:
塔吉塔哈比恩特邮政公司:
tarjetahabiente城市名称:
塔吉塔哈比恩特庄园名称:
Código(例如:EC、BR、AR)del país del tarjetahabiente:
塔吉塔哈比恩特酒店
别称为“受欢迎的人”:
阿佩利多·德尔·塔吉塔哈比恩特。(科莫·阿帕雷塞·恩拉塔·德克雷迪托):
电子邮件:de la persona que recibirálos bienes:
塔吉塔哈比恩特佩迪多中心:
准备发送的已编译数据
XMLREQ
数字信号
会话密钥
URLVPOS
prepod.verifika.com
完成0%
';
返回$html;
}
https链接工作正常。Vpos数据是在表单中设置的。没有必要使用AJAX/jquery以新表单打开表单输出。 “提交”按钮将自动提交表单,因此您只需编辑其目标:
<form name="input" action="html_form_action.php" method="get" target="_blank">
确保调用的响应不是空的,不管ajax部分是什么这是什么<代码>$('submit_second')。单击(函数(){$('submit_second')。单击()代码>??这是ajax的一部分,它应该提交表单数据。尝试了很多事情,但都失败了。这就是为什么在这里发帖。上面引用的代码片段是这样说的-“单击
#提交#秒
按钮时,假装再次单击#提交#秒
按钮。它将永远循环。你是想说-当点击#submit_second
按钮时,发布表单吗?这已经是
按钮的默认行为-你根本不需要任何javascript。但是,也许我不需要,当我只使用
和老式的提交按钮时,它是一样的,空白页。他使用onSubmit按钮来控制弹出窗口的大小。我猜这是有效的,`function alignSend(){document.forms[“second”].setAttribute(“target”,“_blank”);document.forms[“second”].action=“”;document.getElementById(“second”).submit();}`并使用onclick提交事件