靜態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>熱點內容