js怎么实现页面之间的传值?? js怎么实现页面之间的传值?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是父子关系的页面只能通过cookie在A页面用js拼接一段URL传递到B页面 可以在URL后面代上参数.在另一个页面获取此参数就可以了. 页面之间不无法通过JS传递参数的,因为JS属性客户端执行的语言,如果想传递参数只能通过URL后面加参数,再通过JSP(或者ASP.NET)等服务器端语言获取,然后传递给JS访法 补充3楼的,要是父子关系页面的话可以进行传值(像是父页面: var temp = showModalDialog(...),子页面: window.returnValue=a.就是把a传值给temp了) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>无标题页</title> <script type="text/javascript"> function OpenWin() { window.open("father.htm","aa","",""); } </script></head><body> <input id="T1" type="text" /> <input id="Button1" type="button" value="提交" onclick="OpenWin();" /></body></html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>无标题页</title> <script type="text/javascript"> function ReturnVal() { window.opener.document.getElementById('T1').value=document.getElementById('Text1').value; window.close(); } </script></head><body> <input id="Text1" type="text" /> <input id="Button1" type="button" value="关闭" onclick="ReturnVal();" /></body></html> 再发个例子在页面A传值: window.showModalDialog("ModalDialogFrame.aspx?Title=选择组织部门&PageUrl=ParentTreeView.aspx",window,"dialogWidth=380px;dialogHeight=650px;status=no;center=yes;"); 谢谢大家的回复,我已经解决了。 跟ws_hgo说的差不多就在后面加个问号就可以传了 admin_left.aspx?type=1。 接受的时候就<%=Request.QueryString["type"]%> jquery 一个form表单获取多个submit value值的问题 ~有没有有经验的程序员朋友试过与企业签订为期半年的项目开发(java/php)~薪资大概是多少? 又是未定义错误!!! window.onload是页面加载完成才执行,请问页面一开始就执行怎么写? 面向对象的问题:ie中的面向对象表现与ff不同,如何解决?高分求教 50分求救~~~div中写marquee 怎么获取子框架中 复选框和 单选(radio)的值?在线等! 求助大仙 这个功能如何修改 在线编辑器,如何取得其内容? 如何修改“省/市”关联下拉菜单 jQuery查询有关 JavaScript图片轮显效果
在A页面用js拼接一段URL传递到B页面
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function OpenWin()
{
window.open("father.htm","aa","","");
}
</script>
</head>
<body>
<input id="T1" type="text" />
<input id="Button1" type="button" value="提交" onclick="OpenWin();" />
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function ReturnVal()
{
window.opener.document.getElementById('T1').value=document.getElementById('Text1').value;
window.close();
}
</script>
</head>
<body>
<input id="Text1" type="text" />
<input id="Button1" type="button" value="关闭" onclick="ReturnVal();" />
</body>
</html>
window.showModalDialog("ModalDialogFrame.aspx?Title=选择组织部门&PageUrl=ParentTreeView.aspx",window,"dialogWidth=380px;dialogHeight=650px;status=no;center=yes;");
就在后面加个问号就可以传了 admin_left.aspx?type=1。
接受的时候就<%=Request.QueryString["type"]%>