Home > Web Front-end > JS Tutorial > body text

js创建子窗口并且回传值示例代码_javascript技巧

WBOY
Release: 2016-05-16 17:30:40
Original
1183 people have browsed it

Copy 直接可以使用哦 亲们!

复制代码 代码如下:

//父窗口
function onClick(){
var k = showModalDialog(
"view/WriteKey.jsp", 包含的页面
"newwindow", 固定取值
"dialogHeight:200px;
dialogWidth:400px; 宽度
toolbar:no; 是否有工具栏
menubar:no; 是否有菜单栏
scrollbars:no; 滚蛋条
resizable:no;
location:no; 地址栏
status:no; 状态栏
left:100px;
top:100px;"); 唉还有两个属性不记得, 去百度下吧 。
//K是窗口回传的值
//判断 k
if(k!=null&&typeof(k)!=undefined){
.....................ok
}
}
//子窗口 "view/WriteKey.jsp


JS 部分
function trans(tag){
var s=document.getElementById("dy").value+document.getElementById("keyZ").value;
window.returnValue=s;
window.close();
}


ok,完工,
Related labels:
js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!