html opens a new window with a hyperlink and can control window properties

html opens a new window with a hyperlink and can control window properties

1. The window size opened by the HTML hyperlink

Copy code
The code is as follows:

<a href="#" onclick="javascript:window.open('http://www.baidu.com','','height=20,width=20,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')">aaaaaaaaaaaaaaa</a>

2. If there are too many quotation marks in PHP and it is difficult to remove them, you can use the following methods:

Copy code
The code is as follows:

$openNew="onclick=".'"'."javascript:window.open('host_graphics.php?host_id=$host_id&host_address=$host_address','','height=500,width=600,top=300,left=300,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')".'"';
echo "<td style='vertical-align: middle;text-align: center;'><a href=#?host_id=$host_id&host_address=$host_address name='host_click' style='text-decoration:underline;' title='Click to view the host system monitoring diagram' $openNew> $host_name </a></td>"; //Click the host name to view the specific information of the selected host

Tip: onclick="javascript:window.open('12.php','','height=500,width=600,top=300,left=300,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')"

The file can be followed by the value of the variable, such as

host_graphics.php?host_id=$host_id&host_address=$host_address

In this way, the new window that pops up can use GET to obtain the value.

3. Example:

Copy code
The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ThD</title>
</head>
<body>
</body>
<a href="#" onclick="javascript:window.open('http://www.baidu.com','','height=500,width=600,top=300,left=300,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')">aaaaaaaaaaaaaaa</a>
</html>

<<:  Detailed explanation of various usages of proxy_pass in nginx

>>:  MySQL learning database operation DML detailed explanation for beginners

Recommend

JavaScript message box example

Three types of message boxes can be created in Ja...

Reasons why MySQL 8.0 statistics are inaccurate

Preface Whether it is Oracle or MySQL, the new fe...

How to build SFTP server and image server on Linux cloud server

First of all, you can understand the difference b...

Let's talk about destructuring in JS ES6

Overview es6 adds a new way to get specified elem...

DHCP Configuration Tutorial in CentOS7 Environment

Table of contents Configuration command steps in ...

Nginx defines domain name access method

I'm building Nginx recently, but I can't ...

Three ways to achieve background blur in CSS3 (summary)

1. Normal background blur Code: <Style> htm...

Solution to forgetting the password of the pagoda panel in Linux 3.X/4.x/5.x

Enter ssh and enter the following command to rese...

Usage and execution process of http module in node

What is the role of http in node The responsibili...

TCP socket SYN queue and Accept queue difference analysis

First we must understand that a TCP socket in the...

MySQL cross-database transaction XA operation example

This article uses an example to describe the MySQ...

Native JavaScript to achieve skinning

The specific code for implementing skinning with ...

How to write the parent and child directories of HTML relative paths

How to indicate the parent directory ../ represent...