<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
p{ float:left; width:160px; }
</style>
</head>
<body>
<div class="myhistory" style="width:960px;margin:0px auto;">
</div>
<script src="js/jquery-1.4.2.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script>
$("document").ready(function(){
var now=new Date();
var number = now.getSeconds()%10;
var array="[";
if($.cookie("history")!=null){
var obj=eval("("+$.cookie("history")+")");
var sign=true;
for(var i=0;i<obj.length;i++){
if (number==obj[i].id){
sign=false;
}
}
for(var i=0;i<obj.length;i++)
{
if(sign){
if (obj.length>=6){
obj.splice(0,1);
}
}
var data="{\"id\":\""+obj[i].id+"\",\"trimname\":\""+obj[i].trimname+"\",\"url\":\""+obj[i].url+"\",\"img\":\""+obj[i].img+"\"}";
array+=data+",";
}
if(sign){
array+="{\"id\":\""+number+"\",\"trimname\":\""+"英菲尼迪EX35-3.5-V6-A/MT风华版【进口】"+number+"\",\"url\":\""+"http://www.iautos.cn/usedcar/usedcar_detail.asp?uploadid=1161286"+"\",\"img\":\""+"http://photo.iautos.cn/carupload/photo/2011/0518/small/20110518141602579.jpg"+"\"},"
}
}
else{
array+="{\"id\":\""+number+"\",\"trimname\":\""+"英菲尼迪EX35-3.5-V6-A/MT风华版【进口】"+number+"\",\"url\":\""+"http://www.iautos.cn/usedcar/usedcar_detail.asp?uploadid=1161286"+"\",\"img\":\""+"http://photo.iautos.cn/carupload/photo/2011/0518/small/20110518141602579.jpg"+"\"},"
}
array=array.substring(0,array.length-1);
array+="]";
if($.cookie("history")!=null){
var obj=eval("("+$.cookie("history")+")");
for (var i=0;i<obj.length;i++){
var p="<p><img src='"+obj[i].img+"' /><br/><a href='"+obj[i].url+"'>"+obj[i].trimname+"</a></p>";
$(".myhistory").append(p);
}
}
var date=new Date();
date.setMinutes(date.getMinutes()+15);
$.cookie("history",array,{path:'/',expires:date});
// document.write($.cookie("history"));
})
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
jQuery.cookie.rar (3个子文件)
js
jquery-1.4.2.min.js 70KB
jquery.cookie.js 4KB
history.html 2KB
共 3 条
- 1
whxwchg
- 粉丝: 5
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页