English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
I recently made a WeChat promotional page, which judges the device through JQ and performs the download
The built-in browser of WeChat has blocked the download link, so a judgment is made first. If it is the built-in browser of WeChat, then jump to the Anzhi link. If not, then judge if it is an iPhone/Adroid/PC and jump
The code is as follows:
function downloadApp(){} var u = navigator.userAgent; var ua = navigator.userAgent.toLowerCase(); var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //Android Terminal var isiOS = !!u.match(/\(i[^;]+( U;)? CPU.+Mac OS X/); //iOS Terminal if(ua.match(/MicroMessenger/i)=="micromessenger") { //WeChat Built-in Browser $(".download a").click(function(){ window.location.href='http://a.app.qq.com/o/simple.jsp#63;pkgname=Application Name ' }); } if(isiOS){ $(".download a").click(function(){ window.location.href='https://itunes.apple.com/cn/app/Application Name }); } $(".download a").click(function(){ window.location.href='http://a.app.qq.com/o/simple.jsp#63;pkgname=Application Name' }); } $(".download a").click(function(){ window.location.href='Application Link' }); } } }
That's all for this article, I hope it will be helpful to everyone's learning, and I also hope everyone will support the呐喊 tutorial more.
Declaration: The content of this article is from the Internet, the copyright belongs to the original author, the content is contributed and uploaded by Internet users spontaneously, this website does not own the copyright, has not been manually edited, and does not assume relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (When reporting, please replace # with @ and provide relevant evidence. Once verified, this site will immediately delete the content suspected of infringement.)