// ad function dy(code) { var ojs=''; if (code=="top210x90_1"){ document.write(''); document.write(ojs);} if (code=="top210x90_2"){ document.write(''); document.write(ojs);} if (code=="top728x90&qu ot;){ document.writeln("'); document.write(ojs);} i
在数据安全要求不是很高的情况下,我们可以直接用js对cookie进行读写,这样比较方便。
代码如下:
/*
功能:保存cookies函数
参数:name,cookie名字;value,值
*/
function SetCookie(name,value){
var Days = 30*12; //cookie 将被保存一年
var exp = new Date(); //获得当前时间
exp.setTime(exp.getTime() + Days*24*60*60