也可以用URL传递
用location.search读取
用location.search读取
解决方案 »
- 关于替换的正则表达式的小问题,求助啊~~~
- 请问什么么我的FIREFOX里用getElementByID不好用呢???
- 如何实现日期加一天
- 大家帮我看看这个网站的 http://www.zhengxian.com 的放大缩小用什么技术做的
- 移动app中利用百度地图javascript API添加多个标注点的性能问题。
- ●Form中如何判断:用户两项中至少需要填写一项?
- 提问
- 关于cookie问题
- 脚本错误!!在线请教!!
- http://lucky.myrice.com/print.htm这儿没有设置打印纸大小的,怎么办??????快救救我呀。我等了半个月 了。。。
- gmail里的“正在载入”怎样做到的不会抖动?
- 请高手指教
比如 第一个页面中有个
var key
function textcontent(x)
{
key=document.getElementById(x).value
return key
//document.getElementById(x).value=y.toUpperCase()
}这个key值怎么样在其他 html页面使用呢
function textcontent(x)
{
key=document.getElementById(x).value;
document.cookie="key="+key;
return key;
//document.getElementById(x).value=y.toUpperCase()
}
//其他 html页面读取:
<%=request.cookies("key")%>
<html><head>
<script>
var key;
function textcontent(x)
{
key=document.getElementById(x).value;
location.href="test.htm?"+key;
}
</script>
</head><body>
<input id=x value=""/>
<input type=button value="跳转到test.htm页面" onclick="javascript:textcontent('x');">
</body></html><!--第二个页面-->
<html>
<head>
<title>text.htm页面</title>
<script defer>
var url=window.document.location.search;
if(url!=null)
{
url=url.substring(1,url.length);
}
alert(url);
</script>
</head>
<body></body>
</html>