In diesem Artikel wird die Methode zur Aufzeichnung von Gastnamen basierend auf Cookies von JS beschrieben. Teilen Sie es für Ihre Referenz wie folgt weiter:
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> bis bei betitelten Dokument </title> <scripts = "script Sprache =" javascript "> <! Date (); exp.settime (exp.getTime () + (expdays*24*60*60*1000); rightnow = new Date () var wwhtime = 0; LastherIndateFormat = "" + lastherformating; var tayofweek = lasthereInformat.substring (0,3) var datonth = lasthereInformat. = DayofWeek + "," + datonthe + "at" + timeOfdaysetcookie ("wwhenh", rightnow.getTime (), exp) return wwhText} function count (info) {var wwhcount = getcookie ('wwhcount +; {Wwhcount = 0;} elektr = 0;} elektr =} {{{} elektr. . document.cookie.indexof (";", offset); if (endstr == -1) endstr = document.cookie.length; Rückgabe unemplary (document.cookie.substring (offset, endstr);} Funktion getcookie (name) {var arg = "; {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;} Funktion setCookie (name, valual, valu {var argv = sactCookie.Arguments; SetCookie.arguments.length; var expires = (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 + "=" + Escape (value) + ((verfällt == null)? "": ("; ausopires =" + läuft.togmtstring ())) + ((Path == null)? " "; Secure": "");} Funktion DeleteCookie (Name) {var exp = new Date (); exp.settime (exp.getTime () -1); var cval = getcookie (name); document.cookie = name + "=" + cval + "; expires =" + exp.togmtstring (); Auf dieser Seite werden Sie es in Zukunft nicht verwenden. Es wird Ihnen sagen, wie oft Sie jedes Mal auf diese Seite kommen, wenn Sie zu dieser Seite kommen, und die Zeit, die Sie zuletzt zu dieser Seite gekommen sind. Hier " + count () +" Zeit, das letzte Mal ist " + wenn () +". ");} </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 Algorithmusfähigkeiten "," Zusammenfassung von JavaScript -Traversal -Algorithmen und -Techniken "und" Zusammenfassung der Verwendung von JavaScript mathematischer Operationen ""
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.