首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

若有安裝APP, 自動開啟(使用 URL Schema), 若無, 則詢問是不是到商店進行下載

2013-11-15 
若有安裝APP, 自動開啟(使用 URL Schema), 若無, 則詢問是否到商店進行下載。原理:用瀏覽器開啟下載html,

若有安裝APP, 自動開啟(使用 URL Schema), 若無, 則詢問是否到商店進行下載。

原理:用瀏覽器開啟下載html, 利用javascript判斷。?
??若有安裝APP, 自動開啟(使用 URL Schema), 若無, 則詢問是不是到商店進行下載

<html>
<head>
<title>判斷是否有安裝APP,若無,則詢問是否下載</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
var isiPad = navigator.userAgent.match(/iPad/i) != null;
    var isiPhone = navigator.userAgent.match(/iPhone/i) != null;
var isandroid = navigator.userAgent.match(/Android/i) != null;
    
if(isandroid)
    {
'https://play.google.com/store/apps/details?id=com.fonestock.android.yourapp';
    }
if(isiPad)
    {
'yourappurls://'; 
        setTimeout( function() { 
if( confirm( '您似乎沒有安裝, 這個APP, 進行下載?')) { 
                document.location = 'http://itunes.apple.com/tw/app/id4179293XX'; 
if(isiPhone)
'yourappurls://'; 
function() { 
            if( confirm( '您似乎沒有安裝, 這個APP, 進行下載?')) { 
'http://itunes.apple.com/tw/app/id4179293XX'; 
            } 
</script>
?
</head>
<body>
</body>
</html>

热点排行