Print

Print


Here's some getSelection code that works on most modern browsers:

http://www.quirksmode.org/js/selected.html

> -----Original Message-----
> From: Code for Libraries [mailto:[log in to unmask]] On
> Behalf Of Riesner, Giles
> Sent: Thursday, January 13, 2005 01:38 PM
> To: [log in to unmask]
> Subject: Re: [CODE4LIB] Help with bookmarklet
>
> 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.get
Selection.text;else
> Qr='';Qa=prompt('Author...',Qr);Qt=prompt('Title...',Qr);if(Qa
> &&Qt)location.href='http://library.ccbcmd.edu/search~S4/q?auth
or='+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
>
http://lists.clir.org/cgi-bin/wa?A3=ind0501&L=CODE4LIB&E=8bit&P=32826&B=--&T=text%2Fplain;%20charset=US-ASCII&header=1
lists.clir.org
CC-MAIN-2024-18
2874
application/http; msgtype=response
sha1:F4TAPY6NPOVAGS723VTG6TTPTI2HJ6KS
<urn:uuid:f118d03e-0f55-4b87-9132-c00f73643697>
2024-04-22T16:23:52Z
66.175.211.245
text/html
sha1:IFEGSSQHMVL37BL37S5NXG2OBCG6KXOD
<urn:uuid:4493a88e-4ad4-43f3-b7b4-1f749b1a7e0a>
http://lists.clir.org/cgi-bin/wa?A3=ind0501&L=CODE4LIB&E=8bit&P=32826&B=--&T=text%2Fplain;%20charset=US-ASCII&header=1
response
<urn:uuid:ddb3aefe-1a59-4849-92c6-39acf4a1fbf4>
isPartOf: CC-MAIN-2024-18
publisher: Common Crawl
description: Wide crawl of the web for April 2024
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-150
software: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/