1

So, if you want to run a PHP script for example, whatever is hosting you needs to be able to run PHP.

Does this also apply to Javascript? As in, if I want to include Javascript on my webpages, do I need to find a host that will allow me to use Javascript?

  • 1
    Are you asking about purely client side JavaScript? There are also server side JavaScript powered web pages. – Stephen Ostermiller May 29 at 20:41
  • @StephenOstermiller I think client side? Not familiar with the terms, sorry. I want to make HTML/Javascript games. – kumikan May 30 at 12:49
2

No. The server serves a page and that page loads a Javascript file from wherever that file is hosted, be it your own server or a third party's server. Once loaded, this script is run on the clients browser, not on your server. So the server has nothing to do with running / supporting Javascript (which is by definition a "client-side" language).

Of course, there is the possibility that your webpage uses some functionality that is tied with the node.js enviroment (node.js being "server-side" Javascript) in which case your server does actually need to "support" Javascript in the broad sense, meaning the server must run node.js.

I suspect this is not the case in your situation (if you use PHP then probably you are not also using node.js) and you are asking about "plain" Javascript files, in which case please refer to the first paragraph of my answer.

  • Netscape used to have a webserver that was JavaScript based and is still the platform for some legacy applications. – Trebor May 30 at 2:30
0

Javascript is run client side through the user's browser. Therefore Javascript has to be enabled by the user's browser in order to execute properly.

PHP is run server side which means the server has to have PHP enabled. But since Javascript isn't run server side, and is only run through the client's browser, Javascript doesn't have to be enabled by your server. All you need is for your server to serve up HTML.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.