![](/img/trans.png)
[英]Sandboxed iFrame with `target=“_blank”` doesn't open new tab or window
[英]Target _blank doesn't open in new tab/window
我在我的 ionic 項目中使用以下代碼打開新的系統瀏覽器並發布值。 出於某種原因,新窗口無法打開。
我沒有任何錯誤。 該鏈接確實打開,但在自我瀏覽器中。 我希望它在android系統瀏覽器中打開。
var mapForm = document.createElement("form");
mapForm.target = "_blank";
mapForm.method = "POST";
mapForm.action = "http://www.example.com/api/form.php";
// Create an input
var firstname = document.createElement("input");
var lastname = document.createElement("input");
var address = document.createElement("input");
var email = document.createElement("input");
firstname.type = "text"; firstname.name = "firstname"; firstname.value = "John";
lastname.type = "text"; lastname.name = "lastname"; lastname.value = "Doe";
email.type = "text"; email.name = "email"; email.value = "user@example.com";
// Add the input to the form
mapForm.appendChild( firstname );
mapForm.appendChild( lastname );
mapForm.appendChild( email );
// Add the form to dom
document.body.appendChild(mapForm);
// Just submit
mapForm.submit();
使用_system
將起作用。
下面是一個例子:
window.open(url,'_system','location=yes'),!1;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.