IEview-source cannot view the source code. JavaScript: view the source code of the webpage [original] _ javascript skills

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

The Code is as follows:


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


Press enter to view the source code of the webpage.
Method 3: Use vbscript

The Code is as follows:


ILocal = "get.htm.txt"
IRemote = inputbox ("Enter the address you want to get the source code", "feet home", "http://www.jb51.net ")
If iRemote = "" then iRemote = "http://www.baidu.com"
Set xPost = createObject ("Microsoft. XMLHTTP ")
XPost. Open "GET", iRemote, 0
XPost. Send ()
Set sGet = createObject ("ADODB. Stream ")
SGet. Mode = 3
SGet. Type = 1
SGet. Open ()
SGet. Write xPost. ResponseBody
SGet. SaveToFile iLocal, 2


Method 4: Use background languages such as asp and php
Some of the methods used are webmaster-level, so you can use the original method to get the code, there are a lot of scripts in the home.
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.