如何让织梦系统dedecms,PC端跳转移动端?

2022-11-26 0 341

如何让织梦系统dedecms,PC端跳转移动端?

以下为示例代码:

 

首页:

 

<meta name=”mobile-agent” content=”format=html5;url={dede:global.cfg_mobileurl/}/index.php”>

<meta name=”mobile-agent” content=”format=xhtml;url={dede:global.cfg_mobileurl/}/index.php”>

 

列表页:

 

<meta name=”mobile-agent” content=”format=html5;url={dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}”>

<meta name=”mobile-agent” content=”format=xhtml;url={dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}”>

 

详情页:

 

<meta name=”mobile-agent” content=”format=html5;url={dede:global.cfg_mobileurl/}/view.php?aid={dede:field.id/}”>

<meta name=”mobile-agent” content=”format=xhtml;url={dede:global.cfg_mobileurl/}/view.php?aid={dede:field.id/}”>

 

js判断终端的代码:

 

<script type=”text/javascript”>if(window.location.toString().indexOf(‘pref=padindex’) != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf(“?mobile”)<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href=”{dede:global.cfg_mobileurl/}/index.php”;}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>

1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!cheeksyu@vip.qq.com
2. 本站不保证所提供下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有积分奖励和额外收入!
5.严禁将资源用于任何违法犯罪行为,不得违反国家法律,否则责任自负,一切法律责任与本站无关

源码下载

发表评论
暂无评论