| free hosting image hosting hosting reseller online album e-shop famous people | ||
![]() ![]() |
||
NOTE:
The body section code must be after all links to be counted.
If the code is inserted above your links, the total count will be zero.
document.links.lengthwhere:
This value is assigned to the variable max.document is the page itself
links is the link property of that page length is the number of links on the page
setTimeout("alert('Total Links = ' + max)",3000)
The double quotes refer to the parameters of the setTimeout.
The single quotes refer to the message content of the alert box.
And this code goes beneath all links:
The link count value max is printed to the text input box using:
document.total.linkz.value = " " + maxwhere:
The 2 blank spaces between the quotes are used for a nicer cosmetic appearance.document is the page itself
total is the ID of the master form
linkz is the ID for the text input box inside that form
value is the full text string including the link count
This section goes beneath all links:
A DIV placeholder with the ID linkcounter is located as desired above the links.
var str = "Total Number of Links: " + maxThis is printed to the DIV placeholder using:
linkcounter.innerHTML = strWith this method, the innerHTML command is used to perform the writing.
Open Link Count Test Page