confusedideal
Baseband Member
- Messages
- 34
I'm trying to build my own javascript counter. I'm using an external javascript file with the following code in it:
var Counter = Counter + 1
document.write("This page has been visited " + Counter + " times.")
Pretty basic stuff. However, when I run this in my browser, I get this:
This page has been visited NaN times.
Is there a way to initialize the Counter variable once and not worry about it anymore?
var Counter = Counter + 1
document.write("This page has been visited " + Counter + " times.")
Pretty basic stuff. However, when I run this in my browser, I get this:
This page has been visited NaN times.
Is there a way to initialize the Counter variable once and not worry about it anymore?