Use JavaScript Code Implement browser menu commands (the following code is successfully debugged in a Windows XP browser ).
1. Implementation of the open command
[Format]: document.exe ccommand ("open ")
[Note] This is similar to the webbrowser control commands in programming design such as VB. You can also consider it here.
[Example] Add the following content between <body> </body>:
<A href = "#" onclickappsdocument.exe ccommand ("open")> open </a>
2. Implementation of the command 'use notepad edit'
[Format]: location. Replace ("view-source:" + location)
[Note] Open notepad and showSource code.
[Example] Add the following content between <body> </body>:
<A href = "#" onclick = location. Replace ("view-source:" + location)> edit with notepad </a>
3. Implementation of the "Save as" command
[Format]: document.exe ccommand ("saveas ")
[Note] Save the webpage to another directory on the local disk!
[Example] Add the following content between <body> </body>:
<A href = "#" onclickappsdocument.exe ccommand ("saveas")> Save As </a>
4. Implementation of the *** print *** command
[Format]: document.exe ccommand ("print ")
[Note] Of course, you must have installed a printer!
[Example] Add the following content between <body> </body>:
<A href = "#" onclickappsdocument.exe ccommand ("print")> Print </a>
5. Implementation of the "close" command
[Format]: window. Close (); Return false
[Note] This window will be closed.
[Example] Add the following content between <body> </body>:
<A href = "#" onclick = Window. Close (); Return false)> close this window </a>
Implementation of the command
[Format]: document.exe ccommand ("selectall ")
[Description] All content on the webpage will be selected!
[Example] Add the following content between <body> </body>:
<A href = "#" onclickappsdocument.exe ccommand ("selectall")> select all </a>
6. Implementation of the command for source file
[Format]: location. Replace ("view-source:" + location)
[Description] view the source code of the webpage.
[Example] Add the following content between <body> </body>:
<A href = "#" onclick = location. Replace ("view-source:" + location)> View source files </a>
7. Implementation of the "add to Favorites" command
[Format]: window. External. AddFavorite ('url', 'site name ")
[Description] add this page to favorites.
[Example] Add the following content between <body> </body>:
<A href = "javascript: window. External. AddFavorite ('HTTP: // oh.jilinfarm.com ', 'huming new homepage')"> Add to favorites </a>
8. Implementation of the "Sort favorites" command
[Format]: window. External. showbrowserui ("organizefavorites", null)
[Description] The "Sort favorites" dialog box is displayed.
[Example] Add the following content between <body> </body>:
<A href = "#" onclick = Window. External. showbrowserui ("organizefavorites", null)> sort favorites </a>
9. Implementation of the "Internet Options" command
[Format]: window. External. showbrowserui ("privacysettings", null)
[Description] the "Internet Options" dialog box is displayed.
[Example] Add the following content between <body> </body>:
<A href = "#" onclick = Window. External. showbrowserui ("privacysettings", null)> Internet Options </a>