怎样将javascript中定义变量的值传到下一个页面??? 不用window.opener.document方式取值,还有哪些办法?我也急需!就是不通过父窗口的form,get方式传值,cookie怎么传?给一段javascript的代码?!?!海还有哪些方式?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 读写COOKIE的代码:function setCookie(name,value){ var Days = 30; //此 cookie 将被保存 30 天 var exp = new Date(); //new Date("December 31, 9998"); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();}function getCookie(name){ var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return null;}function delCookie(name){ var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();} cookie的容量有不有限制?能否放很大的数据? cookie 一个变量最大量2k,一个cookie 文件里只允许20个变量cookie 文件的个数最大是300个。 刚突发奇想,想到一个简单得办法,试了一下还行,但不知道能不能传大数据。test1.html<script>function SendValue(){ var w = window.open("test2.html", "blank"); w.v = "test value";}</script><input type=button value="SendValue" onclick="SendValue"></input>test2.html<script>function BodyOnLoad(){ alert(parent.v);}</script><body onload="BodyOnLoad()"> 谁能给个jquery 的 中文 日期 控件 var两种区别? 字符转化为小数的方法 关于$(this)的疑惑 IE提示有错误,但我找不出来 关于在html中,使用js变量!请大家帮忙看看,谢谢!急 文件的创建日期 请问怎样关闭QQ的1080端口? 高手指教了~ 请问哪里有JavaScript的手册下载??谢谢啦!! 如何在一副图片上用鼠标拖动显示一个矩形,然后以矩形大小放大图片? 下面函数的ObjName我写select的name为什么说找不到对象???
function setCookie(name,value)
{
var Days = 30; //此 cookie 将被保存 30 天
var exp = new Date(); //new Date("December 31, 9998");
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
else return null;
}
function delCookie(name)
{
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval=getCookie(name);
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
cookie 文件的个数最大是300个。
test1.html
<script>
function SendValue()
{
var w = window.open("test2.html", "blank");
w.v = "test value";
}
</script>
<input type=button value="SendValue" onclick="SendValue"></input>test2.html
<script>
function BodyOnLoad()
{
alert(parent.v);
}
</script>
<body onload="BodyOnLoad()">