<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>在当前界面中将某段代码使用弹出窗展示(不采用外部插件下的简单实现)</title>
<script>
function openWin(){
myWindow=window.open('','','width=200,height=100');
myWindow.document.write($("#processRequir").html());
myWindow.focus();
//加入方法
myWindow.subFun = function(){
//TODO....
alert('弹窗内的方法');
}
}
</script>
</head>
<body>
<input type="button" value="打开窗口" onclick="openWin()" />
<form id="subForm">
<table>
// TODO...
</table>
<input value="测试" onclick="subFun()"/>
//TODO...
</form>
</body>
</html>
转载自https://www.runoob.com/try/try.php?filename=try_win_focus