The location of the window.open pop-up window is problematic. Record it
The code copy is as follows:
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,l occasion=no , status=no') //This sentence should be written in one line
-->
</SCRIPT>
Parameter explanation:
<SCRIPT LANGUAGE="javascript"> The js script starts;
window.open command to pop up a new window;
'page.html' file name of the pop-up window;
'newwindow' The name of the pop-up window (not the file name), if not required, it can be replaced by empty '';
height=100 window height;
width=400 window width;
top=0 The pixel value of the window from the top of the screen;
left=0 The pixel value of the window to the left of the screen;
toolbar=no Whether to display the toolbar, yes is the display;
menubar, scrollbars means menu bar and scrollbar.
resizable=no Whether to allow changing the window size, yes is allowed;
location=no Whether to display the address bar, yes is allowed;
status=no Whether to display information in the status bar (usually the file is already open), yes is allowed;
</SCRIPT> js script end
echo -->
The code copy is as follows:
<html>
<head>
<script type="text/javascript">
function newsnew(){
var w=document.getElementById('w').value;
alert(w);
var h=document.getElementById('h').value;
var hh=document.getElementById("hh").value;
var v=document.getElementById('v').value;
var style="directories=no,location=no,menubar=no,width="+w+"height"+h;
var myFunc=window.open("http://www.baidu.com","nwindow",style);
myFunc.moveTo(hh,v);
}
</script>
</head>
<body>
The height of the new window: <input type="text" id="h" size="4" value="300" />
Width of the new window: <input type="text" id="w" size="4" value="300" />
Vertical coordinates of new window: <input type="text" id="hh" size="4" value="300" />
Horizontal coordinates of the new window: <input type="text" id="v" size="4" value="300" />
<button onclick="new();">Open the heart pop-up window</button>
</body>
</html>