Hi there,
I am building some very basic elements in Hype and have been given some custom javascript code that I have to include in order for this to work in an online platform.
Unfortunately I am not able to get this to work and was wondering if I am missing something or if Hype requires this to be done in a specific way.
Anyway, here is the javascript:
function isBrowserClient() {
try {
if (window.name.slice(0, 4) == "twx-") {
return true;
} else if (window.location.hostname.indexOf("twixlmedia.com") > 0) {
return true;
}
} catch (exception) {
return false;
}
}
function goToURL(url) {
if (isBrowserClient()) {
twxHandleURL(url);
} else {
window.location.href = url;
}
}
var title = document.getElementById("title");
title.addEventListener('click', function() {
goToURL("tp-collection://hidden-collection");
});
Any advise would be appreciated