PDA

View Full Version : Bookmarklet Coolness - CSS Class Finder



a_design_interactive
02-18-2007, 05:01 AM
Hi there. i found this bookmarklet thing... actually a handfull of them somewhere (i'll look for the "main link" in the meantime so i can post it here).

my question is this: this thing is awesome for locating the "CSS CLasses", but what about ID's? i'd love it if i had a similar funtion for locating id's. i tried to modify this thing, but it didn't work. it was totally a guess, so i wasn't surprised, but maybe it's not possible? (maybe that's why there wasn't an "ID Info" bookmarklet next to this one)


javascript:(function()%7Bvar%20a=%7B%7D,b=[],i,e,c,k,d,s=%22%3Ctable%20border=1%3E%3Cthead%3E%3Ctr%3E%3Cth%3E#%3C/th%3E%3Cth%3ETag%3C/th%3E%3Cth%3EclassName%3C/th%3E%3C/tr%3E%3C/thead%3E%22;for(i=0;e=document.getElementsByTagName(%22*%22)[i];++i)if(c=e.className)%7Bk=e.tagName+%22.%22+c;a[k]=a[k]?a[k]+1:1;%7Dfor(k%20in%20a)b.push([k,a[k]]);b.sort();for(i%20in%20b)%20s+=%22%3Ctr%3E%3Ctd%3E%22+b[i][1]+%22%3C/td%3E%3Ctd%3E%22+b[i][0].split(%22.%22).join(%22%3C/td%3E%3Ctd%3E%22)+%22%3C/td%3E%3C/tr%3E%22;s+=%22%3C/table%3E%22;d=open().document;d.write(s);d.close();%7D)()


EDIT:
hey, i found the goovy link. it's right here:
http://www.squarefree.com/bookmarklets/webdevel.html

in Seamonkey / Firefox, it reminds me more of the way Opera's "custom Buttons", or the Opera Web Dev Toolbar works-- very convenient, and MUCH more "lightweight" than your typical "FF xpi", IMHO