download the PhantomJS binary, upload it somewhere and make it executable (chmod +x)
if you are going to make screenshots, setup fontconfig (this is pretty specific to my config but the goal is to make sure to have at least some fonts on your system)
run the following in PHP: $response = exec('/path/to/phantomjs myscript.js');
How to call a JavaScript function from PHP?
<?php
jsfunction();
// or
echo(jsfunction());
// or
// Anything else?
The following code is from xyz.html (on a button click) it calls a wait() in an external xyz.js. This wait() calls …
I have always been trying to avoid using most of the HTTP protocol's properties for the sake of fear of the unknown.
However, I said to myself that I'm going to face fear today and start using headers purposefully. I …
I have a variable in PHP, and I need its value in my JavaScript code. How can I get my variable from PHP to JavaScript?
I have code that looks like this:
<?php
...
$val = $myService->getValue(); // Makes an …