logo       

RE: OT - Detect selected text with JavaScript: msg#00151

lang.ruby.rails.spinoffs

Subject: RE: OT - Detect selected text with JavaScript

Mind you, I just noticed this message in the _javascript_ console for my shiny new Firefox 1.5:
 
"Deprecated method document.getSelection() called. Please use window.getSelection() instead."
 
That's very polite and gentle .. perhaps we should all pay attention.
 
-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx]On Behalf Of David Teare
Sent: Wednesday, 30 November 2005 1:46 PM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx
Subject: Re: [Rails-spinoffs] OT - Detect selected text with _javascript_

Thank-you, that worked like a charm!  

On 29-Nov-05, at 9:18 PM, Bruce Collier wrote:

document.getSelection()

.. many many bookmarklets use this, as do wysiwig textarea doo-hickies


-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx]On Behalf Of David
Teare
Sent: Wednesday, 30 November 2005 10:19 AM
To: rails-spinoffs@xxxxxxxxxxxxxxxxxxxxx
Subject: [Rails-spinoffs] OT - Detect selected text with _javascript_


Hello,

Does anyone know if it is possible for _javascript_ to detect what text 
is currently selected by a user?  I would like to allow the user to 
select some text and then grab that text using JS.

I saw these guys do it : http://www.enlighter.com/ but I'm not sure 
if its possible to do this using JS only or if it needs a browser 
extension.

Thanks!
--Dave.
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@xxxxxxxxxxxxxxxxxxxxx
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Important notice: This message is intended for the individual(s) and entity(s) addressed. The information contained in this transmission and any attached, may be confidential and may also be the subject of legal privilege, public interest immunity or legal professional privilege. Any review, retransmission, dissemination or other use of, taking of any action in reliance upon this information by person or entities other than the recipient is prohibited and requires authorization from the sender. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person) you may not copy or deliver this message to anyone. In such cases you should destroy this message and kindly notify the sender by reply email.

WARNING: Although Infocomp has taken reasonable precautions so that no viruses are present in this e-mail, the company cannot accept responsibility for any loss or damage arising from the use of e-mail attachments.

_______________________________________________
Rails-spinoffs mailing list


Important notice: This message is intended for the individual(s) and entity(s) addressed. The information contained in this transmission and any attached, may be confidential and may also be the subject of legal privilege, public interest immunity or legal professional privilege. Any review, retransmission, dissemination or other use of, taking of any action in reliance upon this information by person or entities other than the recipient is prohibited and requires authorization from the sender. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person) you may not copy or deliver this message to anyone. In such cases you should destroy this message and kindly notify the sender by reply email.

WARNING: Although Infocomp has taken reasonable precautions so that no viruses are present in this e-mail, the company cannot accept responsibility for any loss or damage arising from the use of e-mail attachments.

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise