В этом примере статьи описывается метод записи гостевых имен на основе файлов cookie от JS. Поделитесь этим для вашей ссылки, следующим образом:
<! 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 = utf-8"/> <title> unt title ocpoct </title> <script vesceply exply exply expsday = vares exply exply expsday = varsde = vares expled expled expry = var-vares var-var-var-var-var-var Date (); exp.settime (exp.gettime () + (expdays*24*60*60*1000)); функция, кто (info) {var viefitorname = getCookie ('visitorname') if (visitorname == null) {visitorname = rample («Ваше удостоеноистное имя:«); setCookie ('visitornam rightnow = new Date () var wwhtime = 0; wwhtmime = getCookie ('whenh') wwhtime = wwhtime * 1var lasthereformatting = новая дата (wwhtime); var intlastvisit = (lasthereformatting.getyear () * 10000) + (lasthereformatting.gettemonthymatortingtting () + laSteMattingttingttingttingttingttingttingttingttingttingttingttingtting () * 10000) + (lasthereformatting.getertoriformatting. lasthereIndateformat = "" + lasthereFormatting; var dayOfweek = laShereIndateformat.substring (0,3) var datemonth = lasthereIndateformat.substring (4,11) var timeOfday = lasthereIndateformat.substring (11,16) var = laStheIndateFormatformat.Substring.substring (11,16) var = laShereIndateformatformat. dayofweek + "," + datemonth + "at" + timeofdaysetcookie ("whenh", rightnow.gettime (), exp) return wwhtext} count (info) {var wwhcount = getCookie ('wWhCount') if (wWhcount == null) {wWhcount = 0;} whout {wWhcount + chount -} {wWhcounte + chount -}. ('Whhcount', whhcount, exp); return wwhcount;} function set () {visitorname = rample ("Кто вы?"); Setcookie ('visitorname', visitorname, exp); setcookie ('whwhcount', 0, exp); setcookie ('whenh', 0, exp); document.cookie.indexof (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape (document.cookie.substring (смещение, endstr));} function getCookie (имя) {var arg = name + "= varAlen = arg.length; {var j = i + alen; if (document.cookie.substring (i, j) == arg) return getCookieval (j); i = document.cookie.indexof ("", i) + 1; if (i == 0) break;} return null;} function setCookie (name, value) {var arge arge arge. SetCookie.arguments.length; var истекает = (argc> 2)? argv [2]: null; var path = (argc> 3)? argv [3]: null; var domain = (argc> 4)? argv [4]: null; var secure = (argc> 5)? argv [5]: false; document.cookie = name + "=" + recap (value) + ((истекает == null)? "": ("; истекает =" + expires.togmtString ())) + ((path == null)? "; secure" : "");}function DeleteCookie (name) {var exp = new Date();exp.setTime (exp.getTime() - 1);var cval = GetCookie (name);document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();}// End --></script></head><body>Tip: When you first come to На этой странице вы не будете использовать ее в будущем. Он расскажет вам, сколько раз вы приходите на эту страницу каждый раз, когда вы приходите на эту страницу, и указываете время, когда вы в последний раз приходили на эту страницу <br/> <script language = "javascript"> if (count () == 0) {document.write ("hello!" + Кто () + ". Вы здесь впервые, пожалуйста, дайте мне больше ценных предложений. Был здесь " + count () +" время, последний раз " + когда () +". ");} </script> </body> </html>For more information about JavaScript related content, please check out the topics of this site: "Summary of JSON operation skills in JavaScript", "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation special effects and techniques", "Summary of JavaScript errors and debugging skills", "Summary of JavaScript data structures and Навыки алгоритма »,« Сводка алгоритмов и методов обхода JavaScript »и« Сводка использования математических операций JavaScript ».
Я надеюсь, что эта статья будет полезна для каждого программирования JavaScript.