Count the number of links on the current page
August 28th, 2007
I was testing a Web page indexer the company I work for produces, and I needed a quick way of finding out how many links were on a page. The way I came up with was to create a Favorite/Bookmark containing the following JavaScript instead of a URL:
javascript:if(frames.length<1){alert('This%20page%20has%20'%20+%20document.links.length%20+%20'%20links.')}else{alert('Sorry.%20This%20page%20has%20frames!%20This%20bookmarklet%20only%20works%20on%20frameless%20pages.')}
The easiest way to create this bookmarklet is just to create a Favorite/Bookmark to the current, call it "Link count" and save it. Then go back in and change the properties of the Favorite/Bookmark, changing the URL to the above JavaScript and, if you want, choosing an alternative icon.
Potentially similar posts
- Adding function buttons to the Madcap Flare WebHelp toolbar – January 2010
- Using Publish2 to create a “What I’m Reading” list on your blog – August 2009
- Posterous: quick & simple blogging – via email – July 2009
- What I’m Reading: a new way of posting to Writer River – June 2009
- Xenu link checker 5 years on – November 2008