【发布时间】:2014-09-14 15:01:36
【问题描述】:
我有一个网页可以检测屏幕宽度,然后将移动用户重定向到由 jQuery Mobile 制作的移动 html。但这样一来,一些三星手机用户似乎出现了错误,用户没有查看桌面站点的选项。我目前的代码是这样的:
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobilehome.html";
}
//-->
</script>
<script language=javascript>
<!--
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){
window.location = "http://viewplus.url.ph/mobilehome.html";}
</script>
我想要一个可以将用户重定向到移动网页的网站,但我希望他们也可以选择查看桌面页面。 (就像“桌面”按钮)我知道这是可能的,但我不知道怎么做!请帮忙!
【问题讨论】:
标签: javascript jquery html jquery-mobile mobile