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

javascript - How to setup a textarea with auto suggest from Dictionary - Stack Overflow

programmeradmin2浏览0评论

This Question is bit broad, I did enough research and asking here so that I can get at least some suggestions.

I am trying to set up auto plete textbox/textarea dictionary suggestions. I have tried to setup auto-plete from JSON data from server and I am able to do that.. But here my question is, Can I set up a textarea with auto suggest from dictionary words like when we are entering some text in Word processor. Is it possible through any API available?

This Question is bit broad, I did enough research and asking here so that I can get at least some suggestions.

I am trying to set up auto plete textbox/textarea dictionary suggestions. I have tried to setup auto-plete from JSON data from server and I am able to do that.. But here my question is, Can I set up a textarea with auto suggest from dictionary words like when we are entering some text in Word processor. Is it possible through any API available?

Share Improve this question asked Jan 29, 2013 at 4:20 ExceptionException 8,37924 gold badges87 silver badges141 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 5 +100

You could try Google Places Autoplete API. Here's some related SO thread. I can't find any official documentation to the Google Search Autoplete API, thankfully someone already did the research for us. Follow instructions there, it shouldn't be too difficult to set-up (looks rather straight forward with both JSON and XML notated responses).

I am sure you would have find many ways to achieve autoplete on TextArea. To name a few

  • http://jqueryui./autoplete/
  • http://textextjs./

Both the framework and function are rich enough.

Coming on the dictionary API's

  • http://www.google./dictionary/json?callback=dict_api.callbacks.id100&q=Sweet&sl=en&tl=en Undocumented API of google, returns JSONP

API page for altervista

  • http://thesaurus.altervista/testjs

Few others are

  • http://words.bighugelabs./api.php
  • http://developer.dictionary./products
  • https://webster.cs.washington.edu/cse154/labs/ajax/urban.php?term=india
  • http://www.wordreference./docs/api.aspx

Well, if you do have access to a JSON response from some server, you could use jQuery. http://jqueryui./autoplete/

$(function() {
  function log( message ) {
    $( "<div>" ).text( message ).prependTo( "#log" );
    $( "#log" ).scrollTop( 0 );
  }

  $( "#birds" ).autoplete({
    source: "search.php",
    minLength: 2,
    select: function( event, ui ) {
      log( ui.item ?
        "Selected: " + ui.item.value + " aka " + ui.item.id :
        "Nothing selected, input was " + this.value );
    }
  });
});

use jQuery with your dictionary function.... http://jqueryui./autoplete/

you can download it from here

http://jquery./download/

发布评论

评论列表(0)

  1. 暂无评论