Looking for a word count widget
December 27, 2007 11:35 AM Subscribe
Is there a javascript bookmark available that I can nest on my toolbar that will give me a word count for whatever text I have highlighted (in a text box or otherwise)? Or maybe a firefox addon or greasemonkey script that would do the same?
I've googled it, but everything I've found is for specific websites (i.e. gmail word count, yelp word count, etc.). I'm looking for something that would work on any website.
I've googled it, but everything I've found is for specific websites (i.e. gmail word count, yelp word count, etc.). I'm looking for something that would work on any website.
The fact that you want it to work "in a text box or otherwise" makes it a bit tricky. This will work in Firefox for the regular selection, but not text in a text box:
javascript:alert(document.getSelection().split(" ").length)
posted by steveminutillo at 11:58 AM on December 27, 2007
javascript:alert(document.getSelection().split(" ").length)
posted by steveminutillo at 11:58 AM on December 27, 2007
Response by poster: What if I gave up the otherwise, and only wanted it to work in the selected text box? That's the top priority, the "otherwise" would just be a bonus.
posted by (bb|[^b]{2}) at 11:59 AM on December 27, 2007
posted by (bb|[^b]{2}) at 11:59 AM on December 27, 2007
Best answer: I couldn't figure out how to post a bookmarklet here so I instead posted it to my blog. Hope this helps!
posted by steveminutillo at 12:50 PM on December 27, 2007
posted by steveminutillo at 12:50 PM on December 27, 2007
steveminutillo, it works great in Opera (9.25).
posted by Foci for Analysis at 12:55 PM on December 27, 2007
posted by Foci for Analysis at 12:55 PM on December 27, 2007
Best answer: I updated the bookmarklet to work in Safari and IE, hopefully without breaking Opera. It also now counts words in a slightly better way.
posted by steveminutillo at 9:49 PM on December 27, 2007
posted by steveminutillo at 9:49 PM on December 27, 2007
This thread is closed to new comments.
posted by (bb|[^b]{2}) at 11:40 AM on December 27, 2007