faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 7 people (71%) answered Yes
Recently 5 of 7 people (71%) answered Yes

Entry

how do i get the counter hit for site

May 28th, 2002 14:51
Jean-Bernard Valentaten, Harshada Kajarekar,


Well, if you just want to display the counter and the counter simply 
increases an integer in a text-file containing nothing else than that 
integer, you could simply load it into a dead frame (width or height 
set to 0, name set to counterFrame). Read the frames content with 
parent.frames['counterFrame'].document.innerHTML and write it using 
document.write(counter).
<script language="JavaScript">
<!--
  var counter = parent.frames['counterFrame'].document.innerHTML;
  document.write('<p>' + counter + '</p>');
//-->
</script>
Anything else is not possible using javascript.
I would recommend considering using a serverside language like ASP, 
PHP, JSP, PERL or which ever you are familliar with.
HTH,
Jean