javascript 不同页面间传递数据 在aspx页面A中,插入了谷歌地图,地图的操作完全用js完成。现在想实现,右击地图弹出菜单,其中有个选项是打开新aspx页面B,并把从地图中获得的数据传递到B页面中。现在已经实现右键菜单和打开新页面功能,但是数据传送不成功。数据只是页面A中javascript的一个变量值。请教各位有什么好方法吗?还请讲得详细些,谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 A页面:<html><head></head><body><input type="button" value="传递" onclick="location.href('2.html?a=3')"/></body></html>B页面:<html><head><script>function getValue(XelementId){ var search=location.search; var value=search.substring(search.indexOf("=")+1); var div=document.getElementById(XelementId); div.innerHTML=value;}</script></head><body><div id="div1"></div><script>getValue("div1");</script></body></html> 如果A页面如下:<html><head><script language="javascript"> funtion open () { window.open("B.aspx"); var name = "me"; }</script></head><body><input type="button" value="传递" onclick="open();"/></body></html>怎样把 name的 值传到B页面 ?不通过URL,如果是两个变量的值呢? <html><head><script language="javascript"> funtion open () { var name = "me"; window.open("B.aspx?name="+name); }</script></head><body><input type="button" value="传递" onclick="open();"/></body></html>B.aspxstring name=request.QueryString ["name"] <html><head><script language="javascript"> funtion open () { var name = "me"; window.open("B.aspx?name="+name); }</script></head><body><input type="button" value="传递" onclick="open();"/></body></html>B.aspxstring name=request.QueryString ["name"] html 怎么做?可以得到上个画面传的参数?除了1楼的方法? 这函数怎么调用不了,谁能帮我,我是新手 判断两个日期的大小?用javascript判断!! 请教一个js关于自定义函数的写法! 如何用createElement 动态添加一个链接 找也在学习精通javascript 的朋友? 妈哟,这是啥子 javascript 代码哟!!! JAVASCRIPT中有没有类似PL/SQL中的MOD的函数啊? 点击按钮如何使多选框全部选中?能否给出javascript的代码,谢谢~ 如何在打印预览时去掉打印按钮 Javascript 中如何判断一个元素(譬如checkbox)是否存在? 禁止submit回车提交的问题 如何控制JS绑定事件执行顺序
<html>
<head>
</head>
<body>
<input type="button" value="传递" onclick="location.href('2.html?a=3')"/>
</body>
</html>
B页面:
<html>
<head>
<script>
function getValue(XelementId)
{
var search=location.search;
var value=search.substring(search.indexOf("=")+1);
var div=document.getElementById(XelementId);
div.innerHTML=value;
}
</script>
</head>
<body>
<div id="div1"></div>
<script>getValue("div1");</script>
</body>
</html>
<html>
<head>
<script language="javascript">
funtion open () {
window.open("B.aspx");
var name = "me";
}
</script>
</head>
<body>
<input type="button" value="传递" onclick="open();"/>
</body>
</html>
怎样把 name的 值传到B页面 ?不通过URL,如果是两个变量的值呢?
<head>
<script language="javascript">
funtion open () {
var name = "me";
window.open("B.aspx?name="+name);
}
</script>
</head>
<body>
<input type="button" value="传递" onclick="open();"/>
</body>
</html>B.aspxstring name=request.QueryString ["name"]
<head>
<script language="javascript">
funtion open () {
var name = "me";
window.open("B.aspx?name="+name);
}
</script>
</head>
<body>
<input type="button" value="传递" onclick="open();"/>
</body>
</html>B.aspxstring name=request.QueryString ["name"]