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:[log in to unmask]]On Behalf Of
Art Rhyno
Sent: Thursday, January 13, 2005 2:49 PM
To: [log in to unmask]
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
|