效果:
源码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>静态页面访问量统计</title> </head> <body> <script type="text/javascript"> var pgcount = localStorage.getItem("page_view_pgcount"); if (!pgcount) { pgcount = 0; } pgcount++; localStorage.setItem("page_view_pgcount", pgcount); document.write("您是第:" + pgcount+"次访问"); </script> </body> </html>