I was trying to make a tester for a handler to open an app, and if the app isn’t there, then open the download page. But with the code I have, it doesn’t work exactly how I would like it. The problem appears when the app isnt istalled. Maybe someone can help me in the right direction.
<li onclick="openWebexContent()" class="li-slider">
WBX
</li>
function openWebexContent() {
var appURL = "webex://";
var fallbackURL = "https://webex.com/downloads.html";
var appOpened = true;
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = appURL;
document.body.appendChild(iframe);
setTimeout(function () {
if (!appOpened) {
document.body.removeChild(iframe);
var downloadConfirmation = confirm("Webex kon niet worden geopend! Klik op OK om het te downloaden.");
if (downloadConfirmation) {
window.open(fallbackURL);
} else {
alert("eeuhm een error");
}
}
}, 1000);
iframe.onload = function () {
appOpened = false;
};
}
New contributor
tvTriX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.