Home > Web Front-end > JS Tutorial > body text

How browsers run javascript

藏色散人
Release: 2023-01-06 11:13:11
Original
22486 people have browsed it

How to run javascript in a browser: first open a web page; then right-click on the web page and click [Inspect] to enter the console; then click the Source tag in the top menu; finally write on the right side of the newly created snippet Just JavaScript code.

How browsers run javascript

The operating environment of this article: Windows 7 system, javascript version 1.8.5, Dell G3 computer.

First open a web page. This web page is the domain name address of the web page you need to debug. Otherwise, cross-domain will appear when executing ajax request.

How browsers run javascript

cannot be accessed It doesn't matter, just right-click on the web page, and then you can see the word "Check", then click to enter the console

How browsers run javascript

There are many options after entering, find the Source tab in the top menu , then click to switch to the page

How browsers run javascript

After entering, find Snippets on the page below, and then click the plus sign new snippet below, a new snippet will be created

How browsers run javascript

Then write your JavaScript code on the right side of the newly created snippet. You can write multiple ones. Create one snippet for one running item

How browsers run javascript

After writing it, you can run it. Running is also very simple. Just right-click on the snippet you want to run and you will see a word run. Click on it

How browsers run javascript

## If there is no problem with JavaScript, you can see the execution results in the console below

How browsers run javascript

Recommended study: "

javascript Advanced Tutorial"

The above is the detailed content of How browsers run javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!