<img src onerror="myFunction()">
<script>
function myFunction() { this.scope.action = function() { return "Im here"; }; }
</script>That can be distilled down to:
<script>(function() { (function(scope) { scope.send({payload: "preload"}); // this gets sent when the view is opened in the browser })(scope);})();</script>