View-source, JavaScript view webpage source code

Source: Internet
Author: User

There are actually several ways to view the webpage source code. The most common method is to directly select "view webpage source code" in the browser, but sometimes this method cannot work, the following describes several simple methods for your reference!

First: view-source method

View-source is a protocol that is basically supported by every browser in the early stage. But I don't know why. IE no longer supports this protocol since IE6 Beta2. This method can only be used in FireFox now!

Usage: Enter

View-source:

Press enter to view the source code of the webpage.

Method 2: JavaScript

This method does not seem generic either. It was successfully tested on IE6 and Opere browsers, but it was not successful on FireFox!

Usage: Enter

Javascript: s0000document.doc umentElement. outerHTML; document. write (""); document. body. innerText = s;

Press enter to view the source code of the webpage.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.