[Javascript]/*** pro_id: Product id * brand_name: brand * pro_name: Product id * price: price * catalog: Model * img: Image * file_name: file name */var addHistory = function (pro_id, brand_name, pro_name, price, catalog, img, file_name) {stringCookie = getCookie ('History '); var stringHistory = ""! = StringCookie? StringCookie: "{history: []}"; var json = new JSON (stringHistory); var pro_ids = ''; jQuery. each (json ['History '], function (I, val) {pro_ids + = json ['History'] [I]. pro_id + ",";}); if (jQuery. trim (pro_id) = ''| pro_ids.indexOf (pro_id) =-1) {var e =" {pro_id: "+ pro_id +", brand_name: '"+ brand_name +"', pro_name: '"+ pro_name +"', price: '"+ price +"', catalog: '"+ catalog +"', img: '"+ img +"', file_name: '"+ file_name +"'} "; json ['h Istory ']. push (e); // Add a new record setCookie ('History ', json. toString (), 30) ;}/// display the historical records var DisplayHistory = function () {var p_ele = document. getElementById ('History '); while (p_ele.firstChild) {p_ele.removeChild (p_ele.firstChild);} var historyJSON = getCookie ('History'); var json = new JSON (historyJSON ); var displayNum = 6; for (I = json ['History ']. length-1; I> = 0; I --) {addLi (json ['History '] [I] ['Pro _ id'], json ['his Comment '] [I] ['brand _ name'], json ['History'] [I] ['Pro _ name'], json ['History '] [I] ['price'], json ['History'] [I] ['catalog '], json ['History '] [I] ['img'], json ['History '] [I] ['file _ name'], "history"); displayNum --; if (displayNum = 0) {break ;}}// Add a cookie var addLi = function (pro_id, brand_name, pro_name, price, catalog, img, file_name, pid) {var a = document. createElement ('A'); var href = '/proDetail/' + file_name;. setAttrib Ute ('href ', href);. setAttribute ("target", "_ blank"); jQuery(a).html ("