js scheme 打开手机app的方法

1.iframe

function schemeUrl(url,callbak){
    var ifr = document.createElement("iframe");
    ifr.src = url; /***打开app的协议,如zhe800://goto_home***/
    ifr.style.display = "none"; 
    document.body.appendChild(ifr);
    //app没反应1s后执行另外的方法
    window.setTimeout(function(){
      document.body.removeChild(ifr);
      if(typeof callbak == 'function'){callbak();}
    },1000)
};

  

原文地址:https://www.cnblogs.com/dtdxrk/p/5856688.html