Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added examples to readme

  • Loading branch information...
commit a46c9ba9920d93c95bb6b78a6c9961be841a5709 1 parent 83c8e7f
@drpheltright authored
Showing with 15 additions and 7 deletions.
  1. +15 −7 README.markdown
View
22 README.markdown
@@ -12,19 +12,27 @@ event, then calls the callback. So if you are continously typing
only after you have stopped for the defined `delay` will the
handler be called.
+ // Only search 1.5 seconds after user stops typing
+ $('input[name=search]').bindStop('keydown', function (e) {
+ $.get('search', {"search": $(this).val()}, function (res) {
+ $('#results').html(res);
+ });
+ }, 1500);
+
### $.fn.bindThrottle( eventType, [ eventData ], handler(eventObject), [ delay ] )
This method only calls a callback if the event hasn't been
called in the last `delay` ms. If it has been called it waits
until after the throttle time to call it.
-## Usage
-
-Both methods accept the same parameters which are identical to
-$.fn.bind apart from `bindStop` and `bindThrottle` accept a
-fourth parameter, `delay`, which accepts the jQuery speed
-keywords `slow` and `fast`. Alternatively you can provide
-milliseconds as an integer.
+ // Check password security every 400 milliseconds of typing
+ $('input[name=search]').bindThrottle('keydown', function (e) {
+ if (passwordSecure($(this).val())) {
+ $('#result').html('<p>Password is secure</p>');
+ } else {
+ $('#result').html('<p>Password is <em>not</em> secure</p>');
+ }
+ });
Peace xx
Please sign in to comment.
Something went wrong with that request. Please try again.