Booklaylet

This is a bookmarklet wrapper code to load any other page content inside the opened window, using an overlayed div and an iframe.

This code works on Firefox 1.0-3.0, Safari 2.0-3.0 and Opera 9.0.
It doesn't work on Internet Explorer 5.01-7.0 (IE6 has a limitation to 488/508 chars).

Usage

Example

(function(s, h){var d = document; var x = d.createElement("div");
x.id = "__dd";
x.innerHTML = '<div style="margin: 0 40px">'
	+ '<style>'
	+ '#__dd { position: fixed; bottom: 0; left: 0; width: 100%; }'
	+ '#__dd a { display: block; margin: 0 -2px 0 0; height: 6px; background: #ccc; }'
	+ '#__dd a:hover { background: #e00; }'
	+ '#__dd iframe { border: 1px solid #ccc; width: 100%; height: ' + h + 'px; }'
	+ '</style>'
	+ '<a href="javascript:void()" onclick="document.getElementById(\'__dd\').parentNode.removeChild(document.getElementById(\'__dd\'))"></a>'
	+ '<iframe src="' + s + '" frameborder="0"></iframe>'
  + '</div>';
d.body.appendChild(x);})("http://www.google.com", "450")
		

Bookmarklet example (click to see, bookmark to take):
google.com booklaylet

Bookmarklet example (click to see, bookmark to take):
del.icio.us booklaylet

Download

Download version 1.0 here (947 bytes)
Download del.icio.us version 1.0 here (1.065 bytes).