Re: How to keep static text from being selected
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: How to keep static text from being selected

From: Randy Webb <HikksNotAtHome@aol.com>
Date: Tue Aug 16 2005 - 18:00:18 CEST

ASM said the following on 8/16/2005 10:32 AM:

> jonathon wrote:
>
>> I have a table of line-style entries, much like webmail. When the user
>> double-clicks on a line, a box pops up to enter the data for that
>> entry.
>
>
> a prompt I presume ?

Why does it have to be a prompt? It could just as easily be a dHTML
in-page popup and serve the same purpose.

>> The problem is, whatever word they clicked on in the table is still
>> selected, as if to be copied or cut. It just looks ugly.
>
>
> selection = '';
> in end of prompt function for instance ?

If, and only if, selection refers to the range of selected text.

>> I've seen some IE-only solutions, but none for FF.
>
>
> on my idea : yes any JS clipboard copy with respectuous browsers

The question had nothing to do with clipboard copy, it had to do with
deselecting a selected word.

> Only M$ allows external users (here the Webmaster)
> to play with computer system (clipboard)

It's nice to know that Microsoft, and every other browser vendor, has
fixed every security flaw that allows hackers into computers and that
the only security risk left is allowing webmasters to play with the
clipboard.

> would have to read about hackers with this hole in secutity

"hole in security" is the ability to de-select text? Please explain.

But JS, in just about any browser, can copy text. I say any becuase
there may exist a browser that doesn't allow the dynamic copying of content.

To the OP: Look in ranges, selection and deselection, of ranges.

-- 
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Received on Tue Oct 18 03:09:35 2005