When you surf the Internet, you often experience this: when you click on a link on a page, a confirmation dialog box with a "OK" and "Exit" button is displayed with a warning, welcome or note, prompt, copyright, and so on (Figure 1): If you choose OK, it will continue to be loaded on the target page, and if you select "Exit", do not continue. Thereby giving the viewer a chance to back out.
Figure 1
This is most commonly done through the following JavaScript code in HTML between "<script language= "JavaScript" >
function Rusure ()
{
Question = Confirm ("# #")///# #为 "content of related information"
if (question!= "0")
{
window.open ("URL of target page", "Test Bulletin Window", "width=340,height=163");///Custom Confirmation dialog box size and target page
}
}
</script>
Do you feel a bit like this if you are also making "leaves" enthusiastically? DIY a bar! The following (Figure 2) is the one I tried to customize with the page. The procedure is: first to be used as a button text or picture hyperlink to the target page, its HTML source code is: <a Href= "#" Onclick=window.open ("target page R url", "List", "scrollbars=no,resizable= No,left=100,top=80,width=300,height=80 ") > picture URL or text </a>. The third double quotation mark in parentheses after "Onclick=window.open" defines the height and width of the new window, and does not display the toolbar, menu bar, and scroll bar but only one title bar. However, it is particularly noteworthy: "Href=" after the double quotation mark must be a #; and then use one of the following two methods to implement the confirmation dialog box DIY:
1, the use of Web page production software to do, the production process is as follows:
(1) Run your familiar web production software (such as FrontPage, Dreamwaver, etc.), create a new blank page, enter information text and set to center;
(2) Insert a second row into a 1 Row 3 column table, set the table width, edge width, and cell spacing equal to 0, and set the width of the 1th and 3 cells to be the appropriate pixel (I'm using 80) and set the middle cell width to 10 pixels (no text is entered in the grid). The goal is to have two buttons with a 10 pixel interval);
(3) Enter the word "OK" in the 1th cell, set the ScreenTip and set the hyperlink (note that the target frame is set to a new window); Enter the word "exit" in cell 3rd, set up the ScreenTip and set the hyperlink (because it closes this window, so notice that you type "in the hyperlink Address bar" Javascript:window.close () ").
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.