I am not able to figure out what we really mean when we echo javascript. Does it mean; the function inside script will execute inevitably? I mean, will it execute with out even being called? I've seen long scripts that seem to include a complete page inside an echo statement.
echo "<script type='text/javascript'>
$(function(){
blah blah blah
});
</script>";
It means exactly the same thing as when we echo HTML: that text will be sent to the browser. What the browser does with it is independent of what PHP does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With