Re: Help with bookmarklet

From: Riesner, Giles <GRIESNER_at_nyob>
Date: Thu, 13 Jan 2005 15:37:35 -0500
To: CODE4LIB_at_listserv.nd.edu
I'm not sure what you mean about the object not existing.

The code I sent worked with the exception of putting the
word "undefined" into the prompt box (which I felt would
be confusing to patrons).

Breaking up the selection as you did, doesn't work --
but thanks for the suggestion.

--Giles



-----Original Message-----
From: Code for Libraries [mailto:CODE4LIB_at_listserv.nd.edu]On Behalf Of
Art Rhyno
Sent: Thursday, January 13, 2005 2:49 PM
To: CODE4LIB_at_listserv.nd.edu
Subject: Re: [CODE4LIB] Help with bookmarklet


Is it just that the object doesn't exist? You could do something like:

<a
href="javascript:if(document.getSelection.text)Qr=document.getSelection.text;else
Qr='';Qa=prompt('Author...',Qr);Qt=prompt('Title...',Qr);if(Qa&&Qt)location.href='http://library.ccbcmd.edu/search~S4/q?author='+escape(Qa)+'&title='+escape(Qt)">Combined
Author and Title...</a>

in Firefox, I think you need to break up the getSelection to work in IE.

art
Received on Thu Jan 13 2005 - 15:41:58 EST