SoFunction
Updated on 2025-03-01

Back and refresh implementation methods in javascript

<input type=button value=refresh onclick="()">
<input type=button value=go ahead onclick="(1)">
<input type=button value=Back onclick="(-1)">
<input type=button value=go ahead onclick="()">
<input type=button value=Back onclick="()"> Back+refresh<input type=button value=Back onclick="(-1);()">

In C# Web program, if you write a code to return to the previous page for the page button

("E", "<script language=JavaScript>(-2);</script>");

Among them, (-2) should be written as -2, because the page has been refreshed once before the button event is triggered, so it should be -2.

("<script language=javascript>(-2);</script>");

It should also be written as "-2". It's different from writing scripts directly. () is the previous page
i=1
(i) Go to a specified page

If it is (0), it means refreshing these two JS codes, which are equivalent to the forward and back functions of IE.

The specific use depends on when you need it. For example, the verification when registering is backend verification. This can be used when it does not meet the requirements, which can ensure that the user can input data less repeatedly.

For example: Loading the page:

  function onLoadPage(){
   if(=="SPAN"){
     oFrame=[2];
     oTxt=;
     switch(oTxt){
       case "go ahead":
         (1);
       case "Back":
         ();
       case "refresh":
         ();
     }
   }
}

When you open a jsp page, you must have refreshed it with a client script.

Several ways to refresh a page in Javascript:

1 (0)
2 ()
3 location=location
4 (location)
5 ('Refresh')
6 (location)
7 (location)
8 =

The above is all the content of the back and refresh implementation methods in javascript brought to you by the editor. I hope everyone supports me~