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

JS code to achieve page switching effect

This article example shares the specific code of ...

MySQL 5.7.20 installation and configuration method graphic tutorial (win10)

This article shares the installation and configur...

How to use docker to deploy spring boot and connect to skywalking

Table of contents 1. Overview 1. Introduction to ...

Vue+Bootstrap realizes a simple student management system

I used vue and bootstrap to make a relatively sim...

Reasons and solutions for not being able to detect array changes in Vue2

Table of contents Workaround Why can't I moni...

JS realizes simple picture carousel effect

This article shares the specific code of JS to ac...

Linux dual network card binding script method example

In Linux operation and configuration work, dual n...

Some common mistakes with MySQL null

According to null-values, the value of null in My...

Making a simple game engine with React Native

Table of contents Introduction Get started A brie...

Native js canvas to achieve a simple snake

This article shares the specific code of js canva...

Vue implements internationalization of web page language switching

1. Basic steps 1: Install yarn add vue-i18n Creat...

Docker Compose installation and usage steps

Table of contents 1. What is Docker Compose? 2. D...