エンド ユーザーが使用しているデバイスに応じて、正しいスクリプトを表示し、このコードの誤ったスクリプトを非表示にしたいと考えています。
<ul class="pageitem">
<li class="button iphone"><input name="Submit" value="App Downloads" onclick="window.location='appiphone.html' " type="submit" /></li>
<li class="button ipad"><input name="Submit" value="App Downloads" onclick="window.location='appipad.html' " type="submit" /></li>
<li class="button android"><input name="Submit" value="App Downloads" onclick="window.location='appandroid.html' " type="submit" /></li>
</ul>
これで、デバイスを特定のページにリダイレクトするこのコードができましたが、これ以上は必要ありません。
<script type="text/javascript">
if (screen.width>801)
{
window.location="http://www.xclo.co.uk/PC.html"
}
</script>
<script type="text/javascript"> // <![CDATA[
if ( (navigator.userAgent.indexOf('Android') != -1) ) {
document.location = "android.html";
} // ]]>
</script>
<script type="text/javascript">
var iphone = ((window.navigator.userAgent.match('iPhone'))||(window.navigator.userAgent.match('iPod')))?true:false;
var ipad = (window.navigator.userAgent.match('iPad'))?true:false;
if(iphone){
document.location = 'iphone.html';
}
if(ipad){
document.location = 'ipad.html';
}
</script>
このスクリプトを取得して、関連するコンテンツを表示し、リダイレクトしないようにする方法を教えてください。
ありがとうございました。