- 源码分类:其他源码
- 系统品牌:其他
- 开发语言:HTML
- 数据库:无
功能简介
- 智能终端识别系统
- 双版网页自动跳转
- 轻量级无依赖实现
核心代码
<script>
// 设备类型检测
function detectDevice() {
const isMobile = /Mobile|Android|iPhone/i.test(navigator.userAgent);
return isMobile ? 'mobile' : 'desktop';
}
// 根据设备跳转
window.location.href = detectDevice() === 'mobile'
? 'https://m.example.com'
: 'https://www.example.com';
</script>
部署说明
- 上传至Web服务器
- 替换目标跳转地址
- 无需额外配置
- 即时生效
注:本方案为设备识别基础解决方案,适合快速搭建多端适配入口
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容