The first thing I notice is that you are using @h_classen function name from his example rather than you actual function name jsFilter.
The second issue will be that the Head function will fire well before the Hype Document fully loads.
This will give you an error if you try to refer to any of the Hype elements from within it’s scope
To get around this you can use a second load listener to the window object. Or a setTimeout().
In this example we use the window.onload. and place our call for the hype function within the window.onload’s function.
<script>
function myCallback(hypeDocument, element, event) {
window.onload = function () { hypeDocument.functions().jsFilter(hypeDocument, element, event)}
return true;
}
if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
}
window.HYPE_eventListeners.push({"type":"HypeDocumentLoad", "callback":myCallback});
</script>
HypeFunctionFromHead.hype.zip (12.9 KB)