刚学会用……

我测试用的是Google浏览器哦!语法:
window.open( URL,name,specs,replace )
| 参数 | 说明 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| URL | 打开指定的页面的URL。如果没有指定URL,打开一个新的空白窗口 | ||||||||||||||||||||||||||||
| name | 指定target属性或窗口的名称。支持以下值:
| ||||||||||||||||||||||||||||
| specs |
可选。一个逗号分隔的项目列表。支持以下值:
| ||||||||||||||||||||||||||||
| replace | Optional.Specifies规定了装载到窗口的 URL 是在窗口的浏览历史中创建一个新条目,还是替换浏览历史中的当前条目。支持下面的值:
|
示例:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="jquery-3.4.1.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>小白网页</title>
<script>
function open_win(){
window.open("http://www.baidu.com","_blank / _parent / _self / _top "
,"width=1500,height=680,top=165px,left=180px");
}
</script>
</head>
<body>
<form>
<input type="button" value="打开窗口" onclick="open_win()">
</form>
</body>
</html>
为了分开这个方法,实现共用,可以写个 JS 将这些配置放进去,然后引用在jsp页面引用js就可以了。(思路仅供参考哦~)
2662

被折叠的 条评论
为什么被折叠?



