新窗口window.open() url不显示参数,后面页面可以接收参数 ——后面页面为html

来源:互联网 发布:新浪数据库 编辑:程序博客网 时间:2024/05/20 13:08

前台页面javascript:

var title_src = "/title.html";var body_src = "/body.html?user_id=" + document.actionForm.user_id.value +"&admin_mode=no&orientation=vertical";var foot_src = "/foot.html&user_id=" + document.actionForm.user_id.value + "&tid=" + document.actionForm.tid.value;szUrl+="new_window.html";var strProps="toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=yes,dependent=yes";var win = window.open(szUrl,"New Window",strProps);win.focus();// move to front
后面html:

<html><head><title>New Window</title><script>window.onload = function(){document.getElementById("title_frm").src = window.opener.title_src;document.getElementById("body_frm").src = window.opener.body_src;document.getElementById("foot_frm").src = window.opener.foot_src;}</script></head><frameset  rows="10%,*,13%" border="0"><frame name="title_frm" id="title_frm"  scrolling="no" marginwidth="4" marginheight="4" frameborder="0"><frame name="body_frm" id="tasks_frm"  scrolling="yes" marginwidth="4" marginheight="4" frameborder="0"><frame name="foot_frm"  id="foot_frm" scrolling="no" scrolling="no" marginwidth="4" marginheight="4" frameborder="0"></frameset></html>
新窗口打开一个new_window.html,在父页面设置子页面的src地址。

在子页面动态加载src 使用window.onload()赋值。



原创粉丝点击