安装好了帝国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;?>”>
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- HELLO资源网