学向勤中得,萤窗万卷书。这篇文章主要讲述wap尝试调取app(网易新闻为例)相关的知识,希望能为你提供帮助。
< !DOCTYPE html> < html> < head> < meta charset="UTF-8"> < title> 调起网易新闻app< /title> < meta http-equiv="X-UA-Compatible" content="IE=edge"> < meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"> < meta name="apple-mobile-web-app-capable" content="yes"> < meta content="yes" name="apple-touch-fullscreen"> < meta name="apple-mobile-web-app-status-bar-style" content="black"> < meta name="format-detection" content="telephone=no" /> < style> a { display: block; width: ; text-decoration: none; background-color: #20A0FF; text-align: center; height: 2rem; line-height: 2rem; margin: 3rem auto; } < /style> < /head> < body> < a id="openApp"> 使用网易新闻客户端打开< /a> < script> var s = document.getElementById("openApp"); s.onclick = function() { var url = ‘newsapp://topic/S1515729142180?s=jiguang& spsug=ug& spsugdate=0& spsugextend=0‘; testApp(url); } function testApp(url) { var timeout, hasApp = true; var t1 = Date.now(); var ifr = document.createElement("iframe"); ifr.setAttribute(‘src‘, url); ifr.style.display = "none"; document.body.appendChild(ifr); timeout = setTimeout(function() { var t2 = Date.now(); if(t2 - t1 < 2000) { hasApp = false; if(is_ios()) { location.href = "http://3g.163.com/links/4633"; return; } location.href = "http://3g.163.com/links/4636"; } }, 1000); location.href = https://www.songbingjia.com/android/url; } function is_IOS() { var userAgent = ‘navigator‘ in window & & ‘userAgent‘ in navigator & & navigator.userAgent.toLowerCase() || ‘‘; if(/iphone/i.test(userAgent) || /ipad/i.test(userAgent) || /ipod/i.test(userAgent)) { return true } else { return false; }; } < /script> < /body> < /html>
【wap尝试调取app(网易新闻为例)】
推荐阅读
- C#之app.configexe.config和vshost.exe.config作用区别
- 在Mac电脑上安装eclipse的安卓开发环境
- Redux和React-Redux的实现(中间件的原理和applyMiddlewareThunk的实现)
- 习题 7-6 UVA - 12113Overlapping Squares
- 用Kotlin破解Android版微信小游戏-跳一跳
- Android 开发,你遇上 Emoji 头疼吗()
- 如何使用tensorflow for mobile,开发环境为android studio
- Linux命令参数
- 注册表打开项,本文教您如何通过注册表防范某些开机打开项