Let’s say I have some simple Javascript like:
<script>
var hello = function(){
alert("Hello World!");
}
</script>
.. on a page helloworld.html. If I loaded this script block into another page using Pjax. How do I execute the function hello()?
For security reasons, many browsers will not run Javascript injected by
innerHTML, which I’m thinking Pjax likely uses. (Here’s a minimal example.)Maybe the solution proposed in Pjax’s issue #48 will help