也可以用URL传递
用location.search读取
用location.search读取
解决方案 »
- 请高手指点:用爬虫将网页爬取后,对于网页中特定的javascript脚本,比如<script>alert(XXX)</script>,怎么判断这个脚本能否被触发
- 百度地图上两点的距离是怎样得到的?
- 帮忙修改TAB,让他切换的时候有时间间隔
- 如何做到每N秒自动刷新一次iframe?
- 一段网页两旁自动滚动广告条的代码的问题!就像搜狐首页上的。
- 如何禁止遨游浏览器的“在新窗口中打开页面连接”
- 多少钱可以找到JS高手?
- 请问我怎么把JavaScript中的变量写到html页面中去呢??
- 怎么我的时钟不会动?请高手帮忙。
- 如何取得另一网页里<div id="data">...</div>中的内容??
- 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>