HTML link to launch an app if installed or go to a website if not

谁说我不能喝 提交于 2019-12-23 10:24:07

问题


I have a mobile site written using jQuery Mobile and I have social icons. What I want is that if the user clicks on the Facebook icon to open the facebook app only if the user has the facebook app installed on their phone. If the user does not have the app on the phone I need it to go to Facebook's mobile site instead.

I am using this link to open the app:

<a href="fb://profile/212971392077465" class="facebook">My Fanpage</a>

This works, but now I need help with code to open the mobile site if the user doesn't have these apps installed.

Ideally, this same technique should work with Twitter (I use twitter://status?id=12345 to get to the app).

来源:https://stackoverflow.com/questions/16153863/html-link-to-launch-an-app-if-installed-or-go-to-a-website-if-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!