i'm trying to post values inappbrowser but no success.
it does open browser twice and no data posted.
var options = {
email: '[email protected]',
item_id: 1234,
reference: 1234,
item_descr: 'description',
item_quant: 1,
item_valor: 50 * 100
};
var form = document.createElement("form");
var url = "https://testurl.com";
form.setAttribute("method","post");
form.setAttribute("action",url);
for (var data in options) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", data);
hiddenField.setAttribute("value", options[data]);
form.appendChild(hiddenField);
}
document.body.appendChild(form);
var ref = cordova.InAppBrowser.open(url, '_blank', 'location=yes');
if(ref){
form.submit();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…