1
私はフォームを持っています。このフォームには入力領域があります。ユーザーが入力を選択すると、使用しているデバイスに応じて3つの場所のいずれかに移動します。 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>