The Javascript option will work in pretty much any web environment! So if you are not able to use PHP scripts in your web space, then you should choose the Javascript option. (If you are not sure about whether you can run PHP scripts in your web space, ask your System Administrator about that).
If you are able to run PHP scripts in your web space, you should definitely choose this option. The PHP script runs much more quickly than the Javascript option, allowing the content to be displayed on the page much faster.