静态html页面的访问量统计代码
发布时间: 2023-08-15 01:09:40
Ⅰ 在静态页中如何做访问次数的统计呢
<SCRIPT src="static_click.asp?articleid=[id]"></SCRIPT >
[id]就是你生成文章的唤迟id,上面的这行代码包含在你生成的文章页面
以下是atatic_click.asp的代码
<!-- #include file="inc/conn.asp" -->
<%
articleid=int(trim(request.querystring("articleid")))
sqlStr="update proct set hits=hits+1 where articleid=" & articleid
'给文章点击数加1
conn.execute(sqlStr)
'读出文章点击数弊枝
hits=conn.execute("select hits from proct where articleid=" & articleid)(0)
%>
document.write(<%=hits%>)
更多内和卜李容查看下面网址:
Ⅱ 统计当前网页被访问次数的Jquery代码:
最简单的办法:
<scripttype="text/javascript">
if(localStorage.pagecount){localStorage.pagecount=Number(localStorage.pagecount)+1;}else{localStorage.pagecount=1;}document.write("访问数:"+localStorage.pagecount+"time(s).");</script>热点内容