I have javascript script which I am generating using php. Lets call it js.php , when I put raw text inside and try to link it from other page it works fine. Moment I add php code into script I get
Loading failed for the < script > with source
js.php
< ?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/javascript');
? >
console.log('javascript is loaded');
If I remove the php code from the top file loads fine, moment add it back it gives me error, I have check in firefox and chrome the same issue