[英]How to POST a request in a hybrid application using phone gap
I having a post request with parmeters in hidden field which needs to be redirected to a different site(payment site) in button click which is working correctly in my browser but not working correctly in android device.The site responds with 我在隐藏字段中有一个带有参数的发布请求,需要在按钮单击中将其重定向到其他站点(支付站点),该按钮在我的浏览器中正常运行,但在android设备中无法正常运行。
ExtraFields_f14 parameter is invalid though i have set the value 我设置了ExtraFields_f14参数无效的值
<form method="post" name="redirectForm" id="redirectForm" action="https://g2testi.edirhamg2.ae/PayOnePCB/PaymentPayServlet">
<input type="hidden" id="Amount" name="Amount" value="100" />
<input type="hidden" id="Currency" name="Currency" value="784" />
<input type="hidden" id="ExtraFields_f14" name="ExtraFields_f14" value="http://..." />
</form>
i have tried using window.open(url, '_system', 'location=yes') but no luck I have referenced this phone gap library in my html page 我已经尝试使用window.open(url,'_system','location = yes')但没有运气我在我的html页面中引用了这个电话间隔库
my script 我的剧本
<script src="../Scripts/phonegap-1.4.1.js" type="text/javascript"></script>
function OnSuccess(response) {
$("form#redirectForm").submit();
}
how can i get this site opened in my android device Anyone who knows please give your suggestions 我如何在我的android设备上打开此网站?
Use jQuery Ajax . 使用jQuery Ajax 。 Create a call like:
创建一个呼叫,例如:
$.ajax({
url: "url-to-your-php-or=something.php",
data: {
amount: $('#Amount').val(),
currency: $('#Currency').val(),
ExtraFields_f14: $('#ExtraFields_f14').val()
}
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
var url = your_service_URL;
var str = $('#redirectForm').serialize();
$.ajax({
type: "POST",
url: url,
data: str,
success: function(response){
}
}).done(function() {
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.