I have a php file containing the following line;
$num= "<script type='text/javascript' src='hn_includes/common.js'>boo();</script>";
and of course have a javascript file common.js which contains a function boo()
This is never called...
In an attempt to debug, I've placed a console.log("common.js loaded"); at the top of the common.js file and this tells me that it is indeed being loaded but the call to function boo() never seems to happen.
Additionally, if I simply change my line of code above to;
$num= "<script>boo();</script>";
and add boo() to top of the php file as below;
<script>
console.log ("I'm here");
function boo()
{
console.log("boo");
}
</script>
I get both the "I'm here" and also the "boo".
Any suggestions on where I'm going wrong would be greatly appreciated...