Whenever we see the open, print, advance, saving, back, close this window, disable the link to implement the browser command, and if you have paind to implement it, is it unfortunate? Do you want to achieve? If you can implement your browser's command on the web page, how much interesting is! Let's take a look at how to use the JavaScript code to implement the browser menu command (the following code is called in the browser under Windows XP). First, the implementation of the command in the [File (f)] menu 1, the implementation of the Open command [Format]: Document.execCommand ("Open") [OpeN] This is the command in the WebBrowser control in the programming design of VB Some similarities, everyone can think about this. [Example] Add: Open 2, "Using Notepad Editing Command [ Format]: location.replace ("View-source:" location) [Description] Opens the notepad, showing the source code for the web page in Notepad. [Example] Join between
body>: Directors Editor 3, Some Some To the command of the command [Format]: Document.execCommand ("SaveAs") [Description] Save the page to your local disk! [Example] Add: Save as 4, the implementation of the print command [Format] : Document.execCommand ("print") [Description] Of course, you have to install the printer! [Example] Add: Print 5, the Close command is implemented [Format]: Window.close (); Return False [Description] will turn off this window. [Example] Add: Off This window Second, [Edit (E)] menu Implementation of the command of the command 〖全 command implementation [Format]: Document.execCommand ("SELECTALL") [Description] Will all the contents of the selected web page! [Example] Add: 3, [View (V)] menu Command implementation 1. Implementation of the refresh command [Format]: location.Reload () or history.go (0) [Description] The browser re-open this page.[Example] Add: or join: Refresh 2, the implementation of the source file command [Format]: location.Replace ("View-source:" location) [Description] View the source code for the page. [Example] Add: View Source File 3, Full Screen Display 〗 Command Implementation [Format]: Window.open (Document.Location, "URL", "Fullscreen") [Description] full screen Displays this page. [Example] Join between
body>: full screen Show body>: Add To favorites 2, the implementation of the finishing favorites command [Format]: Window.external.ShowBrowSerui ("Organizefavorites", NULL) [Description] opens the finishing Favorite dialog. [Example] Add: Find Collection 5, [Tool (T )】 Implementation of the command in the menu Internet Options Command [Format]: Window.external.ShowBrowSerui ("PrivacySettings", NULL) [Description] Opens the Internet Options dialog. [Example] Join between body>: Internet option