帝国cms PC端自动跳转到m手机端代码

  安装好了帝国cms手机端后,怎么让他能自动跳转到这个页面呢,网上找了很多教材都不实用,经过自己半个小时的努力,终于完全解决了,下面把代码分享给大家。  我们使用帝国cms做好了手机版和pc版,怎么让他们互联起来吧,比如

[时间:02-23]    [浏览:]    [放入收藏夹]    [查看详情]

  安装好了帝国cms手机端后,怎么让他能自动跳转到这个页面呢,网上找了很多教材都不实用,经过自己半个小时的努力,终于完全解决了,下面把代码分享给大家。

  我们使用帝国cms做好了手机版和pc版,怎么让他们互联起来吧,比如我们用手机访问pc端的时候 ,怎么自动跳转到手机版呢,方法如下:

  因为我的网站只做了首页栏目和内容页,如果你有其他的页面,哪些跳转地址你们就自己去找吧。

帝国cms开发安装手机端模板教程【完整版】








帝国cms PC端自动跳转到m手机端代码:把地址改成你们的

首页

<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i)))
{window.location="http://m.jxbdyx.cn/";}}}
catch(err)
{
}</script>
<meta name="mobile-agent" content="format=xhtml;url=http://m.jxbdyx.cn/">



内容页

<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i)))
{window.location="http://m.jxbdyx.cn[!--titleurl--]";}}}
catch(err)
{
}</script>
<meta name="mobile-agent" content="format=xhtml;url=http://m.jxbdyx.cn[!--titleurl--]">



列表


<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i)))
{window.location="http://m.jxbdyx.cn<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>";}}}
catch(err)
{
}</script>
<meta name="mobile-agent" content="format=xhtml;url=http://m.jxbdyx.cn<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>">





 


标签: