最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Javascript access to spell checker on browsers - Stack Overflow

programmeradmin0浏览0评论

Is it possible to get access to the spell checker that is incorporated in browsers for text areas from Javascript? I would like to be able to control spell checking from withing my code. Most browsers (apart from IE) seem to have some kind of a spell checker built in to them nowadays.

Is it possible to get access to the spell checker that is incorporated in browsers for text areas from Javascript? I would like to be able to control spell checking from withing my code. Most browsers (apart from IE) seem to have some kind of a spell checker built in to them nowadays.

Share Improve this question asked Nov 25, 2008 at 14:51 Rangachari AnandRangachari Anand 1,0028 silver badges10 bronze badges 1
  • 1 What are you attempting to do with the spellchecker? Add words? Turn it off? Spell check something entered into an alert window? – BoboTheCodeMonkey Commented Nov 25, 2008 at 14:59
Add a comment  | 

3 Answers 3

Reset to default 7

The most access that I know of is disabling or enabling spellchecking on a field: Inline Disabling of Firefox Spellcheck?

I don't know of a way that you can directly access the spellchecker of a browser via javascript. If you aren't particular to the spell checker of the browser, there are many open source spell checkers for javascript. Just try googling javascript spell checker.

If you really want to use the browsers spellcheck you might want to create a textbox and set the display to none. You could then put each word in the textbox and then check to see if it's underlined or not. I'm not sure of the feasability of this, just a thought. My suggestion would be to use a javascript spellchecker instead of trying to hack up a way of using the browser's spellchecker.

Browser's don't provide access to their built-in, proprietary spell checker APIs. I'm quite certain there's no x-plat way to do this, let alone a way to do it individually for each browser.

Best bet is to check with each browser vendor and see if they provide any javascript hooking of their spell checker.

I think the most they'll allow is what Bobo said; you can enable/disable it for textboxes, but I don't think they allow any further control than that.

Nope.

If you want control over spell checking, you could do it yourself with AJAX.

(And, incidentally, ieSpell is a free spell checker plugin for IE that is pretty easy for users to install on their own)

发布评论

评论列表(0)

  1. 暂无评论