views:

17

answers:

1

Hello Everyone,

i want to implement ajax functionality like google has done here. this is a transliteration application where user types word in roman and after he/she presses space it sends an ajax call to server bringing back list of probable output words in native script of the language (Urdu in my case). when writing text when i write a word twice (or more) for google does not send ajax request but reuses the result of previous ajax call somehow. for example i write word "mera" and press space, google will send an ajax request and bring back result from the server. but if i write "mera" again even after 3 or four sentences, google does not send ajax request and rather used the previous result. i intend to implement similar functionality using asp.net mvc2. can someone suggest how i can do this. any help and suggestion is highly appreciated
regards

A: 

You need to create a cache in JavaScript that will store the results of whatever search you have.

  1. initialize cache as empty
  2. search
  3. check to see search item in cache. if item not in cache then retrieve list from server. store list in cache. goto step 3. if item in cache do processing.
  4. goto step 2.
Gutzofter

related questions