仅在达到时加载
我正在创建一个 3D 安全表单,如果用户需要将其重定向到 3D 安全银行的网关。
我遇到的问题是以下脚本:
<SCRIPT LANGUAGE='Javascript' >
<!--
function OnLoadEvent()
{
document.mainform.submit();
}
//-->
</SCRIPT>
似乎需要在 bodyOnload="OnloadEvent"
上加载
不幸的是,我无法修改页面的正文标记。因此,我需要在 PHP 脚本上下文中调用代码时加载代码。
其代码是:
} else if($result_arr['valid'] == 'true' && ($mpistatus == '200')) {
$threedurl = urldecode($result_arr['acs_url']);
$paymentauth = $result_arr['PaReq'];
$mdcode = $result_arr['MD'];
echo
"<form name='mainform' action='$threedurl' method='POST'>
<center>
<h1>Processing your 3D Secure Transaction</h1>
<h3>Please click Submit to continue
the processing of your 3D Secure
transaction.</h3>
<input type='submit' value='Submit'>
</center>
<input type='hidden' name='PaReq' value='$paymentauth'>
<input type='hidden' name='TermUrl' value=''>
<input type='hidden' name='MD' value='$mdcode'>
</form>
<SCRIPT LANGUAGE='Javascript' >
<!--
function OnLoadEvent()
{
document.mainform.submit();
}
//-->
</SCRIPT>
";
}
我可以让它仅在脚本内调用时加载表单吗?如果可以,如何实现?
I am creating a 3D Secure form, which if the user is required to re-directs them to the 3D Secure Banks' gateway.
The issue I have is that the following script :
<SCRIPT LANGUAGE='Javascript' >
<!--
function OnLoadEvent()
{
document.mainform.submit();
}
//-->
</SCRIPT>
Appears to need to be loaded on bodyOnload="OnloadEvent"
Unfortunately I can't modify the body tags of the page. So I need the code to load when its called in context of the PHP Script.
The code for that is:
} else if($result_arr['valid'] == 'true' && ($mpistatus == '200')) {
$threedurl = urldecode($result_arr['acs_url']);
$paymentauth = $result_arr['PaReq'];
$mdcode = $result_arr['MD'];
echo
"<form name='mainform' action='$threedurl' method='POST'>
<center>
<h1>Processing your 3D Secure Transaction</h1>
<h3>Please click Submit to continue
the processing of your 3D Secure
transaction.</h3>
<input type='submit' value='Submit'>
</center>
<input type='hidden' name='PaReq' value='$paymentauth'>
<input type='hidden' name='TermUrl' value=''>
<input type='hidden' name='MD' value='$mdcode'>
</form>
<SCRIPT LANGUAGE='Javascript' >
<!--
function OnLoadEvent()
{
document.mainform.submit();
}
//-->
</SCRIPT>
";
}
Can I get it to load the form only when called within the script, if so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然 !只要去掉周围的函数def,代码就会立即执行:
Sure ! Just remove the surrounding function def, and the code will be executed right away:
只需将其添加到窗口的onload方法中即可?
Just add it to the onload method of the window ?