Skip to content

Commit

Permalink
Added documentation for plugin options: serialize, client_side_cache,…
Browse files Browse the repository at this point in the history
… process_data, dataType (README.markdown).
  • Loading branch information
kewlar committed Jun 3, 2015
1 parent fc37090 commit b8daef9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ in any way you wish.

Options
-------
- delay: number of milliseconds to wait after a keystroke, before sending a request
- minimum_characters: don't send a request until the user has typed in this number of characters

- delay: number of milliseconds to wait after a keystroke, before sending a request (default: 400)
- minimum_characters: don't send a request until the user has typed in this number of characters (default: 3)
- serialize: the form to serialize and submit (default: $(element).closest('form'))
- client_side_cache: if set to true, when the user types in something they have already typed in before, jQuery-LiveSearch
will use the last results it has obtained (default: true)
- process_data: function to process form data, before making the AJAX call; should accept and return data as query string
(default: false)
- dataType: data type to pass to jQuery.ajax() call (default: 'json')

Bonus features
--------------

- If the user starts typing before a request is complete, it cancels the original request and starts a new one.
- If the user types in something they have already typed in before, it uses the last results it has obtained.
- If the user types in something they have already typed in before, it uses the last results it has obtained
(client_side_cache: true).
- If the user hits enter before they have 'stopped typing' it sends the request immediately (but you have to block the
form from submitting yourself).

Expand Down

0 comments on commit b8daef9

Please sign in to comment.