If you run PHP as part of a cron then no Javascript will execute. PHP's function is to produce HTML content and return it to the browser, the browser then interprets the HTML (and Javascript) and executes whatever has been produced. The fact your PHP file is just returning the content as plaintext is correct, it's what the server is meant to do; you'd just normally have a browser receiving that content and executing the Javascript.
If you want your PHP file to run web requests when it triggers then you may want to
checkout the cURL[
^] documentation. Essentially you'll want any code to execute within PHP code, not in Javascript.