I want to display a popup if instagram is not installed. I have this code right now:
setTimeout(function () {
$.mobile.changePage( "dialog-instagram.html", { role: "dialog" });
}, 5);
window.location = "instagram://media?id=" + element.title;
If instagram is installed on mobile phone, this launch the app and shows the photo I want. If not installed, launch dialog-instagram.html
Thanks ok. The problem is that dialog-instagram.html is always launched. I just want it to launch if app is not opened. I understand why, code is launched with 5 seconds of delay.
Can that be done? How can I know if window.location is succesful or not?