安装好了帝国cms手机端后,怎么让他能自动跳转到这个页面呢,网上找了很多教材都不实用,经过自己半个小时的努力,终于完全解决了,下面把代码分享给大家。
我们使用帝国cms做好了手机版和pc版,怎么让他们互联起来吧,比如我们用手机访问pc端的时候 ,怎么自动跳转到手机版呢,方法如下:
因为我的网站只做了首页栏目和内容页,如果你有其他的页面,哪些跳转地址你们就自己去找吧。
帝国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;?>”>
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"www.yuankufang.com",如遇到无法解压的请联系管理员!
在线接口 » 帝国cms PC端自动跳转到m手机端代码
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 源码库