Bookmarklets, oh my!

Well, I encountered bookmarklets last week. These are JavaScript snippets which can be executed from the Bookmarks menu in a web browser. The snippets operate on the current page and can be used to scrape data or manipulate info gotten from the page.

Bookmarklets are created using the URI scheme with the protocol type ‘javascript:’ (instead of http: or ftp:, for example).

A common way to use the bookmarklet is to provide it in the form of an href element which you then drag to the bookmarks menu in the web browser.

<a href="javascript:(function(){alert('Fraffic says hello!');})();">drag this to the add bookmark icon on your browser</a>

Unfortunately, Word Press doesn’t seem to play well with inline JavaScript, so I can’t provide you will a live demo.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s