当前位置:网站首页>Phpcms V9 mobile phone access computer station one-to-one jump to the corresponding mobile phone station page plug-in
Phpcms V9 mobile phone access computer station one-to-one jump to the corresponding mobile phone station page plug-in
2022-06-26 09:02:00 【CMS applet plug-in [official]】
There are many jump codes on the Internet , Some jump to different templates through the controller , Some are through js Jump , But there is a characteristic that it can not be realized ,pc and wap One to one jump of the page , It's a hole , I have been trying to solve this problem , I didn't think of a good method until today :
First of all : First, introduce a local site in the public header api file :jumpwap.php
- <script language="JavaScript" src="{APP_PATH}api.php?op=jumpwap&id={$id}&catid={$catid}&page={$page}"></script>
Parametric analysis :
id Represents the id, The list page and the first page are empty
catid The column id, If it is blank, it means the home page
page Pagination , If pc The paging of the mobile station is inconsistent with that of the mobile station , It is recommended to remove this parameter , Otherwise, it may cause paging errors
The second part : In the head head Add inside js Code , It is best to follow the first step of the code ,
- <script type="text/javascript">
- var userAgentInfo = navigator.userAgent;
- var wapurl = $('meta[name="wapurl"]').attr("content");
- if (userAgentInfo.indexOf("Android") > 0 || userAgentInfo.indexOf("iPhone") > 0 || userAgentInfo.indexOf("SymbianOS") > 0 || userAgentInfo.indexOf("Windows Phone") > 0 || userAgentInfo.indexOf("iPod") > 0 || userAgentInfo.indexOf("iPad") > 0)
- {
- if(wapurl){
- window.location.href = wapurl;
- }else{
- window.location.href = "http://m.pweb123.com/index.php";
- }
- }
- </script>
The third step : Development jumpwap.php file
Part of the code :
In this way, you can realize the one-to-one jump of the mobile computer website page , Whether static or not, jump can be realized ,
To refuse to reach out to the party , The code is not open source for the time being , If you think it works for you , You can reward me , It doesn't matter how much , Respect the fruits of labor , It's not easy , Understand more !
边栏推荐
- 【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)
- Live review | smardaten lihongfei interprets the Research Report on China's low / no code industry: the wind direction has changed
- Yolov5进阶之一摄像头实时采集识别
- [300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
- Detailed process of generating URDF file from SW model
- 力扣399【除法求值】【并查集】
- [QNX Hypervisor 2.2用户手册]12.1 术语(一)
- 20220213 Cointegration
- 关于小程序tabbar不支持传参的处理办法
- Line detection_ nanyangjx
猜你喜欢

phpcms v9手机访问电脑站一对一跳转对应手机站页面插件

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)

phpcms小程序插件教程网站正式上线

XSS 跨站脚本攻击

20220623 Adobe Illustrator入门
![[Matlab GUI] key ID lookup table in keyboard callback](/img/b6/8f62ff4ffe09a5320493cb5d834ff5.png)
[Matlab GUI] key ID lookup table in keyboard callback

Yolov5 advanced 5 GPU environment setup

Playing card image segmentation

pgsql_ UDF01_ jx

Segmentation of structured light images using segmentation network
随机推荐
远程工作的一些命令
Tensorboard
Pytorch neural network
Speckle denoising method for ultrasonic image
XSS 跨站脚本攻击
Yolov5 advanced zero environment rapid creation and testing
Summary of common instructions for arm assembly
关于极客时间 | MySQL实战45讲的部分总结
Live review | smardaten lihongfei interprets the Research Report on China's low / no code industry: the wind direction has changed
WBC learning notes (I): manually push WBC formula
yolov5进阶之零环境快速创建及测试
phpcms v9手机访问电脑站一对一跳转对应手机站页面插件
20220213 Cointegration
docker安装redis
Machine learning (Part 2)
攔截器與過濾器的實現代碼
Yolov5进阶之四训练自己的数据集
1.21 study gradient descent and normal equation
1.Intro_ Math (white board derivation and reprint of station B)
Detailed process of generating URDF file from SW model