📄 visitedgoods.js
字号:
setTimeout("productsVisited()",1000);
function productsVisited()
{
var temp = getCookie("ViewProductLog");
var x = new AjaxRequest('XML', 'ProductLog');
x.labelname = "浏览过的商品";
x.currentpage = 1;
x.para = ['ItemID=' + temp];
x.post('updatelabel', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s)
{
var xml = x.createXmlDom(s);
if(xml.getElementsByTagName("body")[0].firstChild!=null)
{
document.getElementById("ProductLog").innerHTML = xml.getElementsByTagName("body")[0].firstChild.data;
}
}
);
}
function CheckEnableValidCode(){
var x = new AjaxRequest('XML', 'status');
x.para = [];
x.post('EnableValidCode', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == "yes") {
document.getElementById("checkcode").style.display = '';
document.getElementById("TxtValdisplayDateCode").value = '';
}
});
}
function getCookie(name)
{
if (document.cookie.length > 0)
{
cookieStart = document.cookie.indexOf( name + "=" )
if (cookieStart != - 1)
{
cookieStart = cookieStart + name.length + 1
cookieEnd = document.cookie.indexOf( ";", cookieStart )
if (cookieEnd == - 1) cookieEnd = document.cookie.length
return unescape(document.cookie.substring( cookieStart, cookieEnd));
}
}
return "";
}
// ------------------------------------增加浏览过的商品Cookie设置开始
function CreactViewProductLogCookie()
{
var productid = @RequestInt_id;
var current = getCookie("ViewProductLog");
if(productid.length != 0)
{
var pid = "";
var pidarr = "," + current + ",";
if(pidarr.indexOf("," + productid + ",") < 0)
{
if(current.length != 0)
{
pid = productid + "," + current;
var arr = pid.split(",");
if(arr.length > 10)
{
pid = "";
for(var i = 0; i < 10; i ++)
{
if(pid.length == 0)
{
pid = arr[i];
}
else
{
pid = pid + "," + arr[i];
}
}
}
}
else
{
pid = productid;
}
setCookie("ViewProductLog", pid, 30, "/", "", false);
}
}
else
{
return "";
}
}
function setCookie(name, value, expires, path, domain, secure)
{
var today = new Date();
today.setTime(today.getTime());
if (expires)
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date(today.getTime() + (expires));
document.cookie = name + '=' + escape(value) +
((expires) ? ';expires=' + expires_date.toGMTString() : '') + // expires.toGMTString()
((path) ? ';path=' + path : '') +
((domain) ? ';domain=' + domain : '') +
((secure) ? ';secure' : '');
}
// ---------------------------------------增加浏览过的商品Cookie设置完毕
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -