我正在使用它来重定向到网页的移动版本(它不在子域中)
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "http://www.site.com/mobile/";
}
//-->
</script>
<script language="javascript">
<!--
var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) {
location.replace("http://www.site.com/mobile/");
}
//-->
</script>
但是当我从手机访问时,我收到一个错误,即找不到服务器?
这是手机版的标题
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<link rel="apple-touch-icon" sizes="114x114" href="images/icontwo.png">
<link rel="apple-touch-startup-image" href="images/startup.png" />
是什么原因造成的?,如果我直接输入,它似乎可以工作......