You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could use something like this, but isn't local storage just local to a browser? Would this count across everyone or just be a count of how many times an individual browser had visited the site?
varcounterContainer=document.querySelector(".website-counter");// get the divvarvisitCount=localStorage.getItem("page_view");// get views from localStorageif(visitCount){// if page_view does existvisitCount=Number(visitCount)+1;localStorage.setItem("page_view",visitCount);//update localStorage}else{//if page_view doesn't exists, create itvisitCount=1;localStorage.setItem("page_view",1);//Add entry for key="page_view"}counterContainer.innerHTML="Views: "+visitCount;// set the page counter
It would be cool if we had a visitor counter at the bottom. I'm imagining a '90s-esque counter
The text was updated successfully, but these errors were encountered: