About Web page source code shield (2)

Source: Internet
Author: User
Tags window
Web page | Source code Well, some people would think that if the other person doesn't see the source code for the frames page. What do you say to open the protected Web page directly? Yes, that's what I'm going to say next. If you want to view the source code in the menu bar of a page to be ineffective. The easiest way to do that is to get rid of the menu bar. And this can be done through pop-up windows. The reason why you do not use hyperlinks to open the No menu bar window is that it will expose the destination address, the viewer can directly in the browser typed address, and bypass the screen bar. To open a No menu bar window with a hyperlink, you must use a link in a Web page that has been protected by the source code.

So let's see how we can get rid of the menu bar using pop-up windows. In fact, all we have to do is to have the target page open in an ad bar. This code is available in almost every large web site. The code is as follows:

〈script〉
〈!--
window.open ("red.htm", "Red", "resizable=yes,width=500,height=300");
--〉
〈/script〉

Here, the first parameter in the parentheses after the window.open is the position of the page displayed by the pop-up window, where the red.htm page file is the first pair position. Then the run will talk about a window that shows a red.htm without a menu bar. Well, our purpose has been achieved. However, this window has a flaw, that is, there is no scroll bar. Because there is no argument about the scroll bar in the Statement of the window: window.open, or I don't know? Welcome to the Master letter pointed out that, so the Web page opened here to make the page to make the navigation page.

However, by using the above method to cancel the menu bar, there must be a second party Web page to do the pop-up work. The page that pops up the window, then, becomes a problem. For example, let's say we use a index.htm to work with pop-up windows. That is, after opening the index.htm, the Red.htm menu bar window pops up. We also mentioned earlier, if you know the address of a Web page, whether or not the page is hidden under the No menu bar, you can see its source code. Then, not letting this red.htm address be exposed is the key to solving the problem. However, as long as the index.htm is open, you can see the source code. But, think back, if we lock up index.htm? As long as the viewer does not have time to check the index.htm before it closes, you can keep its source code. Then, in this index.htm will have to do some articles.
That is, add the code to close the page.

Then we can use Window.close to close the window. The code is as follows:

〈script〉
〈!--
window.open ();
--〉
〈/script〉

So now we're merging the two pieces of code together. Now, the effect is that a window without a menu bar opens. Because the computer's processing speed is very fast, if we write these two pieces of code together immediately, then we can only see the new window. The code is as follows:

〈script〉
〈!--
window.open ("red.htm", "Red", "resizable=yes,width=500,height=300");
Window.close ();
--〉
〈/script〉

The original window has been closed without our noticing. In this way, don't say to see the source code of the page. Here, the Web page that joins the above source code has played a springboard role. However, here, we should pay attention to a few points. First, the Web page used to make a springboard should not be named Index.htm. Change it to a name, and change the default first name to the changed name. This allows the viewer to automatically access the page after the input network. Without letting each other know the name of the page. If you do not, you will cause the other side to guess where the page is. such as: 172.0.0.0/index.htm. This allows you to see the source code for the page by submitting it in a browser: view-source:http://172.0.0.0/index.htm.

After masking the menu bar and toolbars, we thought, how good would it be if we didn't have the top window bar? Here's what we're going to do, if there's a prerequisite, that is, after you open a window without a menu bar using the Springboard page. What are we going to do? is to let us display the content of the Web site only display content, (yes, the site is not for others to browse it?) What do you want with the browser and windows so versatile? As long as the content, the rest are removed. We can do it through a section of JavaScript. The following code is used to define code that does not have any window features:

〈script〉
function Open1 (URL) {
Newwin=window.open (URL, ' NewWindow ', ' fullscreen=1 ')
Newwin.resizeto (800,600)
Newwin.moveto (screen.width/0-800,screen.height/0-600)
}
〈/script〉

Where the function open1 (URL) defines the style of the hyperlink. So, when we write the address of the link, we should write this: Javascript:open1 (URL). For example, I want to open a windowless feature of the Sina home page should be in the text or the hyperlink in the picture to write this: Javascript:open1 (' http:www.sina.com.cn '). Of course, relative paths are also supported in parentheses. The final format should read:

〈script〉
function Open1 (URL) {
Newwin=window.open (URL, ' NewWindow ', ' fullscreen=1 ')
Newwin.resizeto (800,600)
Newwin.moveto (screen.width/0-800,screen.height/0-600)
}
〈/script〉
〈body Oncontextmenu=self.event.returnvalue=false onselectstart= "return false"
〈TD width= "100%" 〉〈a href= "javascript:open1 (' main.htm '), Window.close ()" 〉〈img border= "0" src= "http://edu.cnzz.cn/ Newsinfo/pic/blank1.gif "style=" Position:absolute; left:556; top:142 "width=" 169 "height=" 57 "〉〈/a〉〈/td〉
〈/body〉

In this way, we have reached the page without window edge. And, in this page, the scroll bar is automatically added so that you don't see the following in the same way as before.

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.