For example, there is an ex.js file that contains the usual alert ("AAA"); This script is called from a remote machine:
<script src="http://192.168.0.1/ex.js"> </script> Everything is working. I want this script to be passed to the php script. That is, instead of ex.js, I made exp.php and inserted the following code:
<?php echo 'alert("AAA");';?> However, this does not work. More precisely, it works in the browser, but in the client I need it does not. Comparing the first and second cases in WireShark revealed a difference in the Content-Type. In the working version - application / x-javascript, in the second case text / html.
I want to do this in order to subsequently use some condition, depending on which the necessary JS script will be sent.
<script></script>and<script></script>separately. - toog