JS achieving the browser back and forward part of the native refresh functions

sponsored links
Whenever we see someone else on the page to open, print, forward, save as, back, close this window, disable the right-browser commands such as to achieve the link, while he suffered from failing, is not very much regret? Is not also want to achieve? If we can achieve on the web browser, the command, it will be interesting how things ah! Here we take a look at how to use Javascript code to achieve your browser menu commands (the following code in the browser under Windows XP via debug).

1, [File (F)] menu commands to achieve

1, [] order to achieve open

[Format]: document.execCommand ( "open")
[Note] This and other Programming with VB in the webbrowser control is somewhat similar to the command, we can so pondering pondering.
[For example] In <body> </ body> inserted between:
<a href="#""open")> Open </ a>

2] [use Notepad to edit the realization of the command

[Format]: location.replace ( "view-source:" + location)
[Note] to open Notepad, in Notepad to display the page's source code.
[For example] In <body> </ body> inserted between:
<a href="#""view-source:"+location)> use Notepad to edit </ a>

3] [the Save As command to achieve

[Format]: document.execCommand ( "saveAs")
[Note] this page is saved to a local disk to other directories!
[For example] In <body> </ body> inserted between:
<a href="#""saveAs")> Save As </ a>

4, [ Print ] order to achieve

[Format]: document.execCommand ( "print")
[Note] Of course, you have to install a printer!
[For example] In <body> </ body> inserted between:
<a href="#""print")> print </ a>

5, [Close] order to achieve

[Format]: window.close (); return false
[Note] will close the window.
[For example] In <body> </ body> inserted between:
<a href = "#" Close this window </ a>

2, [Edit (E)] menu commands to achieve

Select] [order to achieve [format]: document.execCommand ( "selectAll")
[Note] to selection page, the entire contents!
[For example] In <body> </ body> inserted between:
<a href="#""selectAll")> Select All </ a>

3, [View (V)] menu commands to achieve

1] [Refresh command to achieve

[Format]: location.reload () or history.go (0)
[Note] re-open the browser page.
[For example] In <body> </ body> inserted between:
<a href = "#" Refresh </ a>
Or acceded to: <a href = "#" Refresh </ a>

2, the source file] [order to achieve

[Format]: location.replace ( "view-source:" + location)
[Note] to view the page source code.
[For example] In <body> </ body> inserted between:
<a href="#""view-source:"+location)> View Source </ a>

3, [] order to achieve full-screen display

[Format]: window.open (document.location, "url", "fullscreen")
[Note] full screen page.
[For example] In <body> </ body> inserted between:
<a href="#""url","fullscreen")> full screen </ a>

4, [Collection (A)] menu commands to achieve

1 Add to Favorites] [order to achieve

[Format]: window.external.AddFavorite ( 'url', ' "site name")
[Note] to this page Add to Favorites.
[For example] In <body> </ body> inserted between:
<a href="javascript:window.external.AddFavorite('http://oh.jilinfarm.com',' Hu revised personal home page ')"> Add to Favorites </ a>

2, Organize Favorites] [order to achieve

[Format]: window.external.showBrowserUI ( "OrganizeFavorites", null)
[Note] open the Organize Favorites dialog box.
[For example] In <body> </ body> inserted between:
<a href="#""OrganizeFavorites",null)> Organize Favorites </ a>

5, [Tool (T)] menu commands to achieve

Internet options] [order to achieve

[Format]: window.external.showBrowserUI ( "PrivacySettings", null)
[Note] open internet Options dialog box.
[For example] In <body> </ body> inserted between:
<a href="#""PrivacySettings",null)> internet options </ a>

6, [] toolbar in order to achieve

1, [] order to achieve progress

[Format] history.go (1) or history.forward ()
[Note] browser opens a page.
[For example] In <body> </ body> inserted between:
<a href = "#" advance </ a>
Or acceded to: <a href = "#" advance </ a>

2, [Back] order to achieve

[Format]: history.go (-1) or history.back ()
[Note] browser, return to the previous page has been viewed.
[For example] In <body> </ body> inserted between:
<a href = "#" Back </ a>
Or acceded to: <a href = "#" Back </ a>

3 Refresh] [order to achieve

[Format]: document.reload () or history.go (0)
[Note] re-open the browser page.
[For example] In <body> </ body> inserted between:
<a href = "#" Refresh </ a>
Or acceded to: <a href = "#" Refresh </ a>

7, the other commands to achieve

Close the window] [Order from time to time the realization of [format]: settimeout (window.close (), closing time)
[Note] will close the window.
[For example] In <body> </ body> inserted between:
<a href = "#" s close this window </ a>
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of JS achieving the browser back and forward part of the native refresh functions

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • WebQQ, ExtJs + Servlet + Hibernate + Spring implementation

    Code for the development of boredom when using ExtJs + Servlet + hibernate (Ant + xdoclet generate HBM files) + spring implementation, Pure whim, but implementation has been more than chat, group chat, what's not achieve, nor how to consider the perfo

  • Build flex + spring + blazeds + hibernate application

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...

  • Process migration from tomcat to websphere changes

    Process migration from tomcat to websphere changes Because customers use the web application server software used by different what tomcat5, tomcat6, websphere5.1, websphere6.1, weblogic8, and so on, and the software used inconsistent standards, ibm's

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.132:15

  • hibernate generic generic DAO

    package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries