Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > how to get text below mouse pointer

Reply
Thread Tools

how to get text below mouse pointer

 
 
snehal
Guest
Posts: n/a
 
      04-18-2006
Hi all

How can I get the word(text) under mouse pointer from my web page?
I want to get the exact word under the mouse pointer from an html page
& send it for further processing.

I am able to get current position of the mouse pointer on the html
form...
But then how to get the text at that position...?
this text can be from the text box, toolbar, caption of button anything
from my form


Thanks & Regards,
Snehal.

 
Reply With Quote
 
 
 
 
Travis Newbury
Guest
Posts: n/a
 
      04-18-2006
snehal wrote:
> How can I get the word(text) under mouse pointer from my web page?
> I want to get the exact word under the mouse pointer from an html page
> & send it for further processing.
> I am able to get current position of the mouse pointer on the html
> form...
> But then how to get the text at that position...?


google "dhtml text at cursor". You will be rewarded with tons of
examples.

 
Reply With Quote
 
 
 
 
snehal
Guest
Posts: n/a
 
      04-18-2006
google "dhtml text at cursor". No result found

 
Reply With Quote
 
Martin Jay
Guest
Posts: n/a
 
      04-18-2006
In message <(E-Mail Removed). com>,
snehal <(E-Mail Removed)> writes
>google "dhtml text at cursor". No result found


"About 690,000 found" when I tried.

Try doing a Google web search.
--
Martin Jay
 
Reply With Quote
 
David Segall
Guest
Posts: n/a
 
      04-18-2006
"snehal" <(E-Mail Removed)> wrote:

>google "dhtml text at cursor". No result found

I don't think that he wanted you to include the quotation marks.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-18-2006
David Segall wrote:
> "snehal" <(E-Mail Removed)> wrote:
>
>> google "dhtml text at cursor". No result found

> I don't think that he wanted you to include the quotation marks.

Just a word of warning...many are very old JavaScript, that is pre-W3C
DOM browsers with *great* browser sniffing like:

if(document.layers){ blah; }
if(document.all){ blah; }

and nary a

if(document.getElementById){ the blah that you should code for; }

so for the newbie if you do not know what I am talking about then much
of what you see with above search will not yield much help. I would
advise using CSS methods

Google "CSS tooltips" and steer clear of JavaScript solutions.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
frederick@southernskies.co.uk
Guest
Posts: n/a
 
      04-18-2006
Jonathan N. Little wrote:
> Google "CSS tooltips" and steer clear of JavaScript solutions.


I don't believe that's what the OP was after; (s)he wanted to be able
to "select" a word, say amidst some text, and then feed it to a script.
I suppose a bit like how you can double-click on a word in a word
processor and then access a context-sensitive menu for a spell-check or
whatever.

I have absolutely no idea how (or why) you'd go about doing it, though.
One for comp.lang.javascript or similar, perhaps?


--
AGw.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-18-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Jonathan N. Little wrote:
>> Google "CSS tooltips" and steer clear of JavaScript solutions.

>
> I don't believe that's what the OP was after; (s)he wanted to be able
> to "select" a word, say amidst some text, and then feed it to a script.
> I suppose a bit like how you can double-click on a word in a word
> processor and then access a context-sensitive menu for a spell-check or
> whatever.
>
> I have absolutely no idea how (or why) you'd go about doing it, though.
> One for comp.lang.javascript or similar, perhaps?



Ah, yes I see you are correct by studying OP's initial post. I am fairly
sure you cannot do what OP wishes with HTML even with JavaScript to
assist. In fact finding the exact mouse position with respect to the
document and viewport is a major challenge for cross-browser support

http://www.quirksmode.org/js/events_properties.html
Javascript - Event properties

let alone 'recognizing' what word is where within the flow of the
document! Where it was varies by browser, viewport size, font size and
font used by user's system! Maybe some java applet or within a flash
object but anywhere in a webpage? Don't think it is possible?



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
snehal
Guest
Posts: n/a
 
      04-19-2006
Hi all,

Thanks for ur replies
Is there is any way to get text selected by the user on form.?
but again the text can be from text box,caption of button, Labels,or
simple text on form...


Thanks once again
Snehal

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser crashes with below code.What is wrong in below code. kiran Javascript 12 12-07-2011 02:38 PM
need to display id of the element under the pointer below the current pointer location Mel Javascript 5 04-21-2007 11:26 PM
Heres a mouse theres a mouse what a mouse do? unholy Gaming 37 09-17-2006 08:59 AM
Could someone scan me a picture of the below? (Read Below) starlightvoyager@yahoo.com DVD Video 1 08-28-2006 05:42 AM



Advertisments