Some Javascript Hacks for Excerpting from the Web

The Bookmarklets for quoting

Drag and drop these to your toolbar in your browsers.


If you like to excerpt from the web (cf editing in designissues) as much as I do, you might find this little snippet of javascript handy:

  w=document.write("<textarea rows='20' cols='80'>\n"
    +"<blockquote cite='"+location.href+"'>\n"
    +"<p><cite><a href='"+location.href+"'>"
    +new Date(document.lastModified).toUTCString()

Note: This version of the script has been created after the mail How to create a quote with a bookmarklet

and this one, for email:

+'\n]]]\n\n-- '
+new Date(document.lastModified).toUTCString())

(Connolly, Aug 2000): Try these bookmarklets, i.e. javascript hacks:

They're illegal URIs, cuz they have spaces in them. But NS4 doesn't seem to deal with %20 in javascript: URIs well. @@need to report a bug.


My code was hacked for NS4 and doesn't work with IE. But just after I released it...

Your JavaScript hacks, re-hacked for IE --


javascript:Hd=document.title; Qu=document.selection.createRange(); 
Today=new Date(document.lastModified).toUTCString();
void(window.open('').document.write('<blockquote>' +Qu.htmlText+ 

javascript: msg=document.title+'%20-->%20'+location.href;


The 'mailto' bookmarklet doesn't include the quoted content due to string 
length limitations (apparently) in IE. It also didn't work in MS's own(!) 
Internet Mail client (a bug that adds everything after '?' to the Subject 
field) however it works just fine for me with Eudora as the client.
--Derek Robinson
Tue, 29 Aug 2000 19:10:11 +0100

@@amaya has a bug with "'s in attribute values. need to report it.


Dan Connolly, Aug 2000
$Revision: 1.16 $ of $Date: 2006/09/27 06:33:28 $ by $Author: kdubost $