2016-12-15 21 views
1

我有一個表單。在這種形式中有一個輸入區域。當用戶選擇輸入時,他們被帶到三個地方之一,取決於他們正在使用的設備。 android - google play store,iphone - itunes store,桌面 - itunes網頁瀏覽器。我能夠檢索iphone和桌面狀態,但Android似乎無法在具有操作屬性的表單標記上工作。鏈接工作正常。不知道問題是什麼。謝謝。表單在iPhone和Android上發生的動作屬性鏈接

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<meta name='viewport' content='initial-scale=1'> 
</head> 
<body> 
<div class='main'> 

    <br/> 
    <br/> 
    <br/> 
    <form id="store-link" > 
     <input type='submit' value='Download'/>   
    </form> 
    <br/> 
    <br/> 
    <br/> 
</div> 
<div class='footer'> 
    <p>footer</p> 

</div> 
</body> 
<script> 

var a = document.getElementById('store-link'); 
if (navigator.userAgent.match(/Android/i)) { 
a.action = 'https://play.google.com/store/apps/details?id=com.ksmobile.launcher'; 
} 
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))){ 
a.action = 'itms://itunes.apple.com/us/app/peanuts-storygif-christmas/id1181016912?mt=8'; 
} 
else { 
a.action = 'https://itunes.apple.com/us/app/peanuts-storygif-christmas/id1181016912?mt=8'; 
} 

</script> 
</html> 

回答

0

可能是因爲該仿真器/手機上,您選擇了「總是使用Chrome/web瀏覽器」,而不是「只使用一次」,所以現在它打開所有谷歌在瀏覽器中播放的網址,而不是提示您使用玩商店或瀏覽器(或只使用Play商店)。

您可以在設置中清除這些首選項。

相關問題