Today, finding a page on the Internet that does not use at least some script is no easier than at a university - a student without a mobile phone. And just as a mobile phone does not work without the appropriate infrastructure, so web scripts need some kind of power to animate them. What exactly is required to run the script?
Instructions
Step 1
First of all, let's determine the place where the script should be launched.
The execution of the script contained in the script should be handled by the "language processor" (or "language interpreter") - a program that sequentially reads the lines of the script and performs the prescribed actions. Such a program can be part of the server software, or part of the browser code, depending on which language the script needs to be executed in. The PHP script is executed on the server; therefore, a running web server is required to run the script. A JavaScript script is executed in a browser, so a browser on our computer is enough to run scripts in this language.
Step 2
Now more about scripts executed by the server.
You can also install a web server on your computer. He will not even need an Internet connection - such a server is called "local". This is very handy for writing and debugging scripts in server-side languages (php, perl, etc.). On the net you can find distributions (installation kits) of both paid and free servers for personal use - for example, Zend, Denver, XAMPP, AppServ, etc. But if constant access to the Internet is not a problem, then you can do without a local server, and use a full-size web server of some hosting provider. Usually this service is paid, but not very expensive. But you will be able to use a lot of additional modules, plugins, statistics handlers and other useful things without worrying about installing and maintaining them in working order.
Step 3
And finally, about scripts executed in the browser.
As for the client scripts, we can write and run the simplest of them right now, without buying anything, installing or launching anything. We do this: first of all, open any text editor, such as notepad. We write in it only 3 lines of code:
alert ("JavaScript is running!")
Now we save this code in a file with the html extension (for example, js-test.html) and run it as usual by double-clicking it. By the extension html (HyperText Markup Language - "hypertext markup language"), the operating system recognizes the file type and launches the program assigned to launch such files - this is a browser. And the language interpreter in the browser will read and execute the script. The result will look like the image.