Thursday, August 14, 2008

Test "Quote from a blog" bookmarklet

abc

function mozInnerHTML(node) { var str = ''; for (var i = 0; i < str =" '';" i =" 0;" attr =" node.attributes.item(i);">'; } else { str += '>'; str += mozInnerHTML(node); str += ''; } break; case Node.TEXT_NODE: str += node.nodeValue; break; default: break; } return str; } var sel = window.getSelection(); var node = sel.getRangeAt(0).commonAncestorContainer; var html = mozOuterHTML(node); var uri=document.location; var title = document.title; var win=window.open('','','width=500,height=400'); win.document.write('

' + html + ' [' + title + ']' + '

' );
[]

def

4. Quote from a blog, which lifts text from a page and formats it for posting to a blog, along with attribution and a link. Because this version uses an advanced Mozilla-only technique described here, though, you might rather use the version that Phil Windley discussed here.

[Jon Udell: Bookmarklets 101]

ghi

No comments: