在Page2.htm中
<script>
function window.onbeforeunload()
{
for(iIndex=0;iIndex<document.all.length;iIndex++)
{
var vObject=opener.document.element(document.all(iIndex).tagName);
vObject.type="hidden";
vObject.value=document.all(iIndex).value;
opener.document.appendChild(vObject);
}
}
大概就这样了.
<script>
function window.onbeforeunload()
{
for(iIndex=0;iIndex<document.all.length;iIndex++)
{
var vObject=opener.document.element(document.all(iIndex).tagName);
vObject.type="hidden";
vObject.value=document.all(iIndex).value;
opener.document.appendChild(vObject);
}
}
大概就这样了.
解决方案 »
- 求教JQuery ui插件的一个关于拖动的问题
- 求jQuery得到checkbox的选中的value值
- JQUERY 动态+标记元素
- 求两年前流传过的js打印文件的一个EXCEL.RAR
- 页面验证iframe中input后 iframe中的页面会从新加载
- 用JavaScript如何实现网页间的变量传输?
- 用JavaScript在收藏夹中建立目录?急!!!急!!!急!!!
- 求助!!动态表格生成问题!!!
- window.open函数能不能使新打开窗口覆盖原窗口而不是另开窗口?
- 怎么样用JavaScript或者JScript将“2003-1-6”这样的格式转换成“2003-01-06”这样的格式?
- 使用js判断表单输入的数据类型,有点不如意,进来帮帮忙吧!
- 右击弹出窗口事件
运行提示:opener.document为NULL或不存在
这里页面2是由页面1中window.open打开的
{ var vObject ;
alert(document.frm.length);
for(iIndex=0;iIndex<document.frm.length;iIndex++)
{
vObject = opener.document.createElement("<input>");
vObject.name = document.frm(iIndex).name;
alert(vObject.name);
//vObject.type = "hidden";
vObject.type = "text";
vObject.value = document.frm(iIndex).value;
alert(vObject.value);
opener.document.body.appendChild(vObject);
}
}