整体主要使用script控制,目前Android通过,iOS未测试。
a标签源码部分
<a id="Download"href="javascript:;">点击这里</a>
Script源码部分
<script type="application/javascript"> var anspk = "#";//APP链接 var al = document.getElementById("Download"); window.location.href = anspk; al.onclick = function() { window.location.href = anspk } </script>
全段源码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Android APP Download</title> <style> a{text-decoration:none} a{color:#FF0000;} p{color:#008000;} </style> </head> <body> <h1 style="text-align: center"> <p>APP将自动下载</p> </h1> <h3 style="text-align: center"> <p>如果没自动下载,<a id="Download"href="javascript:;">点击这里</a>手动下载……</p> </h3> <script type="application/javascript"> var anspk = "#";//安卓APK链接 var al = document.getElementById("Download"); window.location.href = anspk; al.onclick = function() { window.location.href = anspk } </script> </body> </html>