How to create java a script

How to create java a script

Java Script is a programming language which is processed by the browser at display of contents of the website. The JS file represents the ordinary text document which can be created and edited by standard means of a system.

Creation of the file



It is possible to create the JS file in several ways. The code of the program is stored in the document and does not require additional processing by the program compiler. To create the document which will be read in a system as the file of a script click with the right mouse button on free area in "Conductor" of Windows or on a desktop. In the appeared context menu select the Create parameter - "The text document". Further it will be offered to you to set a name for future file and its expansion. If you want the document to be correctly connected to the HTML page, it is desirable to set to a script a name with use of Latin letters. After the indication of a name move the cursor to the right for a point which went right after the name. Change the .txt extension offered Windows to ".js" and click Enter. Confirm performing operation and change of expansion. Creation of the document JS is complete.

Editing

 

Click with the right mouse button on the newly created file. In the appeared menu select the option "Open with the Help". In the list of the offered parameters select the program through which to you will make the easiest input of a program code. For example, you can select a standard application "Notepad" or Wordpad. If you have other editors capable to open the JS files, they will also be displayed in the list. After opening you can begin to enter the code.

Having finished writing of a script, save changes in the file by means of the File command - "Save".



You can also create the JS file by means of "Notepad". For this purpose open the program, having passed into the Start menu - "All programs" - "Standard" - "Notepad". After that begin to enter a program code. After the end of input press the Save as button and select the folder in which you would like to save your future Java Script file. Set a name for the file and after it put the .js extension. Thus you specify all necessary parameters for identification of the Java Script file in a system.

Thus the Java Script file can be executed as independently, and in a browser window through loading on a website HTML page.



After creation of the document you can start it both in Windows, and in the browser installed on the computer through the Open with the Help menu. The JS file can be connected in HTML by means of the special directive <script type = "text/javascript" href = "put_do_fayla_JS">. At the same time the <script> code should be specified in the section <head> </head> the HTML file.

Author: «MirrorInfo» Dream Team


Print