javascript - In h5 page I want to open app(had schema already) when the iPhone install the app if not jump to appstore -


as said in title,i used following js code:

<a href="https://itunes.apple.com/cn/app/id1111" id="openapp" style="display: none">openapp</a> <script type="text/javascript"> document.getelementbyid('openapp').onclick = function(e){      window.location.href = "haocai://";     window.settimeout(function(){          window.location.href = "itms-apps://itunes.apple.com/us/app/id11113?mt=8";     },3000) }; 

this code has problem, if iphone has no app, safari popup problem, can problem solved?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -