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

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -