gpt4 book ai didi

WP7.1 应用内浏览器上的 Javascript 重定向

转载 作者:行者123 更新时间:2023-12-02 05:09:51 25 4
gpt4 key购买 nike

我试图在 Window Phone 7 的应用程序内浏览器上运行 Javascript 重定向代码,但似乎根本没有发生重定向。

片段:

<script type="text/javascript">
function sform() {
document.forms["frm"].submit();
}
</script>
</head>

<body onload="sform()">
<form action="https://payment-endpoint-url.com" method="POST" name="frm">
<input type="hidden" name="Ref_ID" value="***" />
<!--- some other data that varies depending on the transaction -->
</form>
</body>

我已经尝试了所有可能的方法来使用 Javascript 进行 HTTP POST 重定向,并且还尝试了一些特定于 IE 的方法,但它们不起作用。有解决方法吗?会不会是不允许重定向的新安全功能?

最佳答案

这段代码似乎对我有用:

 <html>
<head>
<script type="text/javascript">
function sform() {
document.getElementById("submit1").click();
}
</script>
</head>
<body onload="sform()">
<form action="https://payment-endpoint-url.com" method="POST">
<input type="hidden" name="Ref_ID" value="***" />
<input type="submit" value="Go" id="submit1" />
</form>
</body>
</html>

关于WP7.1 应用内浏览器上的 Javascript 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6838847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com