Javascriptが新機能です。以下のを想像して、今すぐウィンドウナビゲータスタンドアローンとイベントリスナー - Javascript
if(("standalone" in window.navigator) && window.navigator.standalone){ //1
var node = false;
document.addEventListener('click', function(event) {
node = event.target;
while(node.nodeName !== "A" && node.nodeName !== "HTML") {
node = node.parentNode;
}
if('href' in node && node.href.indexOf('http') !== -1 &&
(node.href.indexOf(document.location.host) !== -1)){
event.preventDefault();
document.location.href = node.href; }
},false);
}
:私は、次のコードの一部を研究し、理解しようとしていますが、ページhttp://test.gr/index.html上にあり、最初の条件が真である(// 1。)。このページにこのリンクがあります:
<a href="http://test.gr/info.html" target="_blank">Info</a>
1)最初の条件(// 1)がtrueの場合は?
2)リンクをクリックした後はどうなりますか?コードがwhileループを渡すとき?リンクは同じタブまたは新しいタブで開きますか?
おかげ