ajax父页面main.html

来源:互联网 发布:linux支持哪些文件系统 编辑:程序博客网 时间:2024/05/21 14:59
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <title>获取子窗口内容</title>    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="this is my page">    <meta http-equiv="content-type" content="text/html; charset=UTF-8">        <!--<link rel="stylesheet" type="text/css" href="./styles.css">--><script type="text/javascript">window.onload = function(){//给btn注册事件document.getElementById("btn").onclick = function(){//支持谷歌浏览器if (window.navigator.appVersion.indexOf("Chrome")!=-1) {//弹出居中,弹出的子窗口urlvar openUrl = "main_sub.html";//弹出窗口的宽度var iWidth=600;//弹出窗口的高度var iHeight=400;//获得窗口的垂直位置var iTop =(window.screen.availHeight-30-iHeight)/2;//获得窗口的水平位置var iLeft = (window.screen.availWidth-10-iWidth)/2;var sFeatures = "height="+iHeight+", width="+iWidth+", top="+iTop+", left="+iLeft;window.open(openUrl, "jeo_chow", sFeatures);}//非谷歌else { var sFeatures = "dialogWidth=400px;dialogHeight=400px";// 弹出模式对话框:参数1:要弹出的页面;参数2:把当前创建传给子页面; 参数3:子窗口的属性 window.showModalDialog("main_sub.html",window,sFeatures);}}}</script>  </head>    <body>    你选择的内容为:<span></span><br><input id="btn" type="button" value="请选择"/>      </body></html>

0 0
原创粉丝点击