views:

132

answers:

3

Possible Duplicate:
Javascript: I have a custom right-click menu but still want the spellcheck!

Is there a JS property or command to see if a word is underlined in red (ie. needs to be spellchecked) in Firefox?

Ideally, for sample code it would be like... if I right click on a word the is underlined in red it will alert:

//watches for right click action
if(firefox.isUnderlinedForSpellcheck == true) {
  //display firefox spellcheck menu
} else {
  //perform my action
}

Anyone have any thoughts?

+1  A: 

I don't think that you can since it's browser specific. You can use a second spellchecker and then it's most likely they will both find the same errors.

marcgg
+1  A: 

This is the answer: do not try to create your own custom context menu on a web site. Nobody likes them.

Josh Stodola
-1 This is a GREAT comment, but it is not an answer. If the OP gives up on the right click idea, might there still be a reason to work out the stated problem?
David Berger
I don't mind that you -1 my answer, but understand that I have been down the road of creating custom context menus. I implemented some a few years ago (to help the user), and I had to remove them a year later after so many users complained. And I am certain that is why he is asking this question (he doesnt want his custom menu to override the browser spell checker).
Josh Stodola
A: 

Josh Stodola is right. You are trying to get back functionality that you turned off by having a custom right-click handler. If you drop this handler, then Firefox behaves in the way that its users expect it to.

Most browser users (especially Firefox users) don't expect your application's functionality to come from the context menu. You are doing them a disservice by putting it there. They expect browser functionality (not page-specific functionality) to come from the context menu--and you are hiding it from them.

You would be better off to place these menu items directly on your page (with appropriate icons or whatever, of course). This is how the Web works. This is how people expect it to work.

Paul Hanbury