我的ios全屏網絡應用程序中有一個iframe,iframe源是來自batchgeo.com的地圖。我添加了一個html鏈接來將數據從地圖傳遞到應用程序(例如example.com?name = bob),它會重新載入同一頁面,但會載入數據。但是,當點擊鏈接時,它退出應用程序並在Safari中打開鏈接,我希望它在全屏應用程序中打開,而不是去Safari瀏覽器。iOS web應用程序從iframe鏈接全屏退出
我試了一些像<a target="_parent" href="http://example.com?name=bob">
沒有運氣。我也嘗試在web應用程序中使用jquery更改鏈接的默認行爲,但是不想使用我從另一個類似問題中找到的代碼工作,但這不適用於iframe中的鏈接:
if (window.navigator.standalone) {
$(document).on(
"click",
"a",
function (event) {
event.preventDefault();
var aurl = $(event.target).attr("href");
if (aurl) {
location.href = $(event.target).attr("href");
}
else {
location.href = this;
}
}
);
}
有什麼建議嗎?提前致謝。
你碰巧來解決這個問題?我有同樣的問題 – 2014-12-23 15:46:53