Home >Web Front-end >JS Tutorial >How to run js files
How to run the js file: first create an HTML sample file; then put the js in the html; finally, run the html code to run the js.
The operating environment of this article: Windows 7 system, Dell G3 computer, javascript version 1.8.5.
What is a js file? How to run js, I believe many people know js, but don't know how to run js. Let's take a look at how to execute js files.
What is a js file?
js file is a file that achieves dynamic effects on web pages and can store javascript scripts. Compared with c, the function of js is relatively weak, but if you want to achieve dynamic effects, use js Still more than enough.
How does js run?
js is not a simple language. We cannot use other language programs to run js independently. To run js, we must first have a support function for js to read and write files. Secondly, js scripts depend on the browser. operation and cannot be used alone.
Generally, we put js in html and run js by running html code. If node.js is installed on your computer, we can also use node.js to run js. document.
There are two ways to implement js dynamic programs. The first is the binary method, and the second is the script method. The binary implementation is to directly compile the programs we have written and then turn them into codes that can be recognized by the machine. , and then the machine executes it. The binary method has certain disadvantages. We can only see the execution and use, but not the content of the program itself.
Script implementation is to execute commands one by one. For example, we use a text editor to view and edit. When the program is executed, the system will issue an editor and translate it into something that the machine can recognize. According to the relevant Programs are executed sequentially, and script execution is much more efficient than binary execution.
The above is how to run the js file? A complete introduction to the two running modes of js. If you want to know more about JavaScript tutorial, please pay attention to the php Chinese website.
The above is the detailed content of How to run js files. For more information, please follow other related articles on the PHP Chinese website!