Java monitoring data collection 3 (under collection)

Source: Internet
Author: User

1,
<Script language = "JavaScript" type = "text/JavaScript">
Window. Location. href = "A. jsp? B = "+ window. Location. href;
</SCRIPT>
2,
<Script language = "JavaScript">
Window. History. Back (-1 );
</SCRIPT>
3,
<Script language = "JavaScript">
Window. navigate ("A. jsp ");
</SCRIPT>
4,
<Script language = "JavaScript">
Self.location+'a.htm ';
</SCRIPT>
5,
<Script language = "JavaScript">
Top. Location = 'a. jsp ';
</SCRIPT>

===== Jump to other pages through the pop-up selection box in Javascript ====
<Script language = "JavaScript">
<! --
Function logout ()...{
If (confirm (" "))...{
Window. Location. href = "A. jsp? B = B"
}
}
-->
</SCRIPT>

===== Jump to other pages through a prompt box in Javascript ====
<Script language = "JavaScript">
<! --
Function logout ()...{
Alert ("jump or not ");
Window. Location. href = "A. jsp? B = B"
}
-->
</SCRIPT>

======================================
License:
<Input name = "pclog" type = "button" value = "go" onclick = "location. href = 'HTTP: // www.baidu.com/'">

Link:

<A href = "javascript: history. Go (-1)"> return to the previous step. </a>

<A href = "<% = request. servervariables (" http_referer ") %>"> return to the previous step </a>

Direct jump:

<SCRIPT> window. Location. href = 'HTTP: // www.baidu.com/'; </SCRIPT>

Open a new window:

<A href = "javascript:" onclick = "window. Open (closed)"> Baidu </a>

JS jump to page

 

 

Function tourl (UL ){
If ("" = ul | null = UL ){
Alert ("thanks ");
} Else {

Window. Open (UL); // This is the new window

// Window. Location. href = ul; // This is directly redirected to the current page

}
Return;
}

 

1. directly jump to the original form using
Window. Location. href = "the page you want to jump ";
2. Open the page in the new form:
Window. Open ('page you want to jump ');

Window. History. Back (-1); return to the previous page

3. Usage
License:
<Input name = "pclog" type = "button" value = "/go" onclick = "location. href = 'Connection address'">
Link: <a href = "javascript: history. Go (-1)"> return to the previous page </a>
<A href = "<% = request. servervariables (" http_referer ") %>"> back to previous page </a>
Direct jump:
<SCRIPT> window. Location. href = 'Connection address'; </SCRIPT>
Open a new window:
<A href = "/JavaScript:" onclick = "window. open ('Connection address', '', 'height = 500, width = 611, scrollbars = Yes, status = yes')"> 123 </a>

 

<SCRIPT>
<! --
Window. Open

('Page.html ', 'newwindow', 'height = 100, width = 400, Top = 0, Left = 0, toolbar = No, menubar = No, scrollbars = No,

Resizable = No, location = No, status = no ')
// Write a row
-->
</SCRIPT>

After running the script, page.html will be opened in the newwindow of the new form, with a width of 100, a height of 400, 0 pixels from the screen top, 0 pixels left, no work

Bar, no menu bar, no scroll bar, no size adjustment, no address bar, no status bar. Please compare.
In the preceding example, several common parameters are involved. In addition, there are many other parameters. For details, see section 4.

Iv. Parameters
Here, yes/no can also use 1/0; pixel value is a specific value, in pixels.

Parameter | value range | description

Alwayslowered | yes/no | specifies that the window is hidden behind all windows
Alwaysraised | yes/no | specify that the window is suspended above all windows
Depended | yes/no | whether to close the parent window at the same time
Directories | yes/no | whether the directory bar of nav2 and 3 is visible
Height | pixel value | window height
Hotkeys | yes/no | set the Security Exit hotkey in the window without menu bar
Innerheight | pixel value | pixel height of the document in the window
Innerwidth | pixel value | pixel width of the document in the window
Location | yes/no | whether the location bar is visible
Menubar | yes/no | whether the menu bar is visible
Outerheight | pixel value | set the pixel height of the window (including the decorative border)
Outerwidth | pixel value | set the pixel width of the window (including the decorative border)
Resizable | yes/no | whether the window size can be adjusted
Screenx | pixel value | pixel length between the window and the left boundary of the screen
Screeny | pixel value | pixel length between the window and the upper boundary of the screen
Scrollbars | yes/no | whether the window has a scroll bar
Titlebar | yes/no | whether the title bar of the window is visible
Toolbar | yes/no | whether the toolbar of the window is visible
Width | pixel value | pixel width of the window
Z-Look | yes/no | whether the window floated above other windows after being activated

========================================================== ==================

[1. The most basic pop-up window Code]
In fact, the code is very simple:

 

<Script language = "JavaScript">
<! --
Window. Open ('page.html ')
-->
</SCRIPT>
Because it is a piece of javascripts code, they should be placed between the <script language = "JavaScript"> tag and </SCRIPT>

. <! -- And --> are used for some earlier browsers, and the code in the labels is not displayed as text in these old browsers. Yes

This is a good habit.
Window. Open ('page.html ') is used to control the new window page.html. If page.html is not in the same path as the main window,

Specify the path above. The absolute path (http: //) and relative path (../) are acceptable. You can use single quotes and double quotes, but do not mix them.
This piece of code can be added to any HTML location, either between

, Especially the Page code is long. If you want the page to pop up early, try to move it forward.

[2. After setting, the pop-up window is displayed]

Let's talk about the settings in the pop-up window. You just need to add something to the code above.
We will customize the appearance, size, and position of the pop-up window to adapt to the specific situation of the page.

 

<Script language = "JavaScript">
<! --
Window. Open ('page.html ', 'newwindow', 'height = 100, width = 400, Top = 0, Left = 0, toolbar = No,

Menubar = No, scrollbars = No, resizable = No, location = No, status = no ')
// Write a row
-->
</SCRIPT>
Parameter description:
<Script language = "JavaScript"> the JS script starts;
Window. Open command to pop up a new window;
'Page.html 'name of the pop-up window;
'Newwindow' indicates the name of the pop-up window (not the file name). It is optional and can be replaced by null;
Height = 100 window height;
Width = 400 window width;
Top = the pixel value between the 0 window and the top of the screen;
Left = 0 the pixel value between the window and the left of the screen;

Width = 250, toolbar = No, scrollbars = "+ scroll +", menubar = No ");
// Write a row
Opendeskdoc ument. Write ("<title> example </title> ")
Openmediaworkflow Doc ument. Write ("<body bgcolor = # ffffff> ")
Openmediaworkflow Doc ument. Write ("Openmediaworkflow Doc ument. Write ("new window opened! ")
Openmediaworkflow Doc ument. Write ("</body> ")
Openmediaworkflow Doc ument. Write ("Openmediaworkflow Doc ument. Close ()}
</SCRIPT>
</Head>
<Body>
<A href = "#" onclick = "openwin ()"> open a window. </a>
<Input type = "button" onclick = "openwin ()" value = "open window">
</Body>
</Html>
Check if the code in openmediaworkflow Doc ument. Write () is not standard HTML? You only need to write more rows according to the format. An error occurs when you add one or more labels. Remember to end with opentracing upload Doc ument. Close.

[9. Ultimate application-Cookie control in the pop-up window]
In retrospect, although the pop-up window above is cool, there is a little bit of a problem (immersed in joy, do not find it ?) For example, if you place the above script in a page that requires frequent access (such as the homepage), the window will pop up every time you refresh the page, isn't it very annoying? :-(Is there a solution? Yes! Follow me. We can use cookies to control it. First, add the following code to the <SCRIPT>
Function openwin ()
{Window. Open ("page.html", "", "width = 200, Height = 200 ")}
Function get_cookie (name)
{Var search = Name + "="
VaR returnvalue = "";
If (document. Cookie. length> 0 ){
Offset = Document. Cookie. indexof (Search)
If (offset! =-1 ){
Offset + = search. Length
End = Document. Cookie. indexof (";", offset );
If (END =-1)
End = Document. Cookie. length;
Returnvalue = Unescape (document. Cookie. substring (offset, end ))
}
}
Return returnvalue;
}
Function loadpopup (){
If (get_cookie ('popped') = '){
Openwin ()
Document. Cookie = "popped = yes"
}
}
</SCRIPT>
Then, use <body onload = "loadpopup ()"> (not openwin, but loadpop !) Replace the original <body> sentence on the home page. You can refresh the page or enter the page again, and the window will no longer pop up. Real pop-only-once!

<Span id = "tiao"> 3 </span> <a href = "javascript: Countdown"> </a> automatic jump in seconds ...... <Meta http-equiv = Refresh content = 3; url = '/search/billsearch. js' </ul>

<! -- Start the script -->
<Script language = "JavaScript" type = "">
Function countdown (SECs ){
Tiao. innertext = secs;
If (-- secs> 0)
SetTimeout ("Countdown (" + secs + ")", 1000 );
}
Countdown (3 );
</SCRIPT>
<! -- Script end -->

 

 

 

<A href = "javascript: void (0);" onclick = "javascript: modifypassword (); "> </a>

In this way, although the URL under IE6 requests the background, the foreground is not dynamic,

The correct format should be

<A href = "javascript: void (0);" onclick = "javascript: modifypassword (); Return false; "> </a>

 

Examples of personal favorites are as follows:
1: <a href = "####"> </a>
2: <a href = "javascript: void (0)"> </a>
3: <a href = "javascript: void (null)"> </a>
4: <a href = "#" onclick = "Return false"> </a>
5: <span> </span> (it seems that it cannot be displayed in ff )-------------------------------------------------------------------------------

Use JavaScript with caution: void (0) When testing today, it is clear that the program has been executed and the final result is correct, but the page is not refreshed.

The test results in firefox2.0 and IE7 are normal, but IE6 is not refreshed! After careful investigation, we found that the page Link is <a href = "javascript: void (0)" onclick = "xxx_func ();"...> Test </a>. The problem lies in the void (0!

Let's take a look at the meaning of void (0) in javascript: void in Javascript is an operator that specifies to calculate an expression but does not return a value.
The format of the void operator is as follows:
1. javascript: void (expression)
2. javascript: void expression
Expression is a standard JavaScript expression to be calculated. Parentheses outside the expression are optional, but it is a good habit to write. You can use the void operator to specify a hyperlink. The expression is calculated, but no content is loaded in the current document. The code above creates a hyperlink, and nothing will happen after the user clicks. When a user clicks a link, void (0) is calculated as 0, but it has no effect on JavaScript. <A href = "javascript: void (0)"> clicking here does not happen. </a> that is to say, if you want to perform some processing, but do not refresh the page as a whole, you can use void (0), but when you need to refresh the page, you should be careful. In fact, we can use <a href = "javascript: void (document. Form. Submit ()"> to perform a submit operation. Under what circumstances will void (0) be used more often, without refreshing the new version? Of course it is Ajax. If you look at Ajax web pages, you will usually see a lot of void (0 ), :), so before using void (0), You 'd better first think about whether the page needs to be refreshed as a whole.

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.