www.edusoho.com/download/mobile?client=android&code=edusoho
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>应用正在下载...</title> | |
| <style> | |
| .message {font-style: 12px; color: #444;} | |
| </style> | |
| </head> | |
| <body> | |
| <div id="message">正在载入数据...</div> | |
| </body> | |
| <script> | |
| var urls = { | |
| iphone: 'https://itunes.apple.com/cn/app/kuo-zhi-xue-tang/id887301045', | |
| android: 'http://download.edusoho.com/edusoho-android-2.3.3.apk', | |
| weixin: 'http://a.app.qq.com/o/simple.jsp?pkgname=' + 'com.edusoho.kuozhi', | |
| }; | |
| var uagent = navigator.userAgent.toLowerCase(); | |
| var href = window.location.href.toLowerCase(); | |
| if (uagent.search("iphone") > -1 || uagent.search("ipad") > -1 || href.search("iphone") > -1 || href.search("ipad") > -1) { | |
| if (urls.iphone) { | |
| window.location = urls.iphone; | |
| } else { | |
| var messageNode = document.getElementById("message"); | |
| messageNode.parentNode.removeChild(messageNode); | |
| document.write("<div class='message'>暂无iphone版本...</div>"); | |
| } | |
| } else if(uagent.match(/MicroMessenger/i)=="micromessenger") { | |
| window.location = urls.weixin; | |
| } else { | |
| window.location = urls.android; | |
| } | |
| </script> | |
| </html> |
这个网页里面的源码可以进行参考
本文介绍了如何根据设备类型(Android、iOS、微信)自动跳转到相应的教育软件下载页面,确保用户能够轻松获取所需应用。
1428

被折叠的 条评论
为什么被折叠?



