Two nice bookmarklets

Seth had a nice bookmarklet in a post today, it shows all links on a page. I altered it a bit to make the links clickable, and it works quite nice. So here’s a bookmarklet:

javascript:(function(){as=document.getElementsByTagName("a");str="<ul>";for(i=0;i<as .length;i++){str+="<li><a href="+as[i].href+">"+as[i].href+"</a>\n"}str+="</as></ul>";with(window.open()){document.write(str);document.close();}})()

I immediately made another one as well which shows all the meta’s on a page:

javascript:(function(){metas=document.getElementsByTagName("meta");str="<ul>";for(i=0;i<metas .length;i++){str+="<li><b>Name:</b> "+metas[i].name+"<br />\n<b>Content:</b> "+metas[i].content+"\n" }str+="</metas></ul>";with(window.open()){document.write(str);document.close();}})()

Tags: ,


Yoast.com runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

4 Responses

  1. David Bradley Blog TipsBy David Bradley Blog Tips on 4 October, 2007

    Such a great idea. In Firefox add a keyword to each bookmarklet, e.g. links and meta and then they become accessible as address bar shortcuts if you’re a keyboard as opposed to a mouse jockey…

    db

  2. LionelBy Lionel on 10 June, 2008

    Nice addon.
    Simple but useful.
    Thank you for sharing your knowledge!

  3. YossarianBy Yossarian on 3 July, 2008

    Hi Joost, just popped by to pick up your greasemonkey scripts and noticed these. There seems to be a small problem with it though.

    The code extends right across your screen rather than going onto a new line so it looks a bit messy.

    Also the actual bookmarklet links dont appear to work properly the code in the links only shows:

    “javascript:(function(){as=document.getElementsByTagName(”

    rather than the full code.

    It very well could be working and it is just my Firefox being stupid, so sorry for this pointless post if thats the case!

  4. Techie ZoneBy Techie Zone on 1 July, 2009

    @Yossarian

    I have the same problem, I am not sure how this can be used or the bookmarklet itself is dysfunctional.