Skip to content

Commit 672a02d

Browse files
committed
Merge branch 'master' of github.com:Ziptastic/ziptastic-jquery-plugin
2 parents 4d5ff11 + 868b294 commit 672a02d

3 files changed

Lines changed: 39 additions & 11 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Thomas Schultz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1+
# ziptastic-jquery
2+
> Seamlessly integrate [Ziptastic!](https://www.getziptastic.com) with jQuery
3+
14
## Usage
25

3-
### Standalone lookup
6+
#### Standalone Lookup
47

58
Can be used to query for a specific zip code.
69

7-
$.ziptastic(48867, function(country, state, state_short, city, zip){
8-
// Use the data...
9-
})
10+
```js
11+
$.ziptastic(48867, function(country, state, stateCode, city, zip) {
12+
// Match found.
13+
});
14+
```
1015

11-
### Element Selector
16+
#### Input Keyup Wrapper
1217

13-
$('#zip')
14-
.ziptastic()
15-
.on('zipChange', function(event, country, state, state_short, city, zip) {
16-
// Use the data...
17-
});
18+
```js
19+
$('input.zip')
20+
.ziptastic()
21+
.on('zipChange', function(event, country, state, stateCode, city, zip) {
22+
// Match found.
23+
});
24+
```

jquery.ziptastic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
return this.each(function() {
3737
var ele = $(this);
3838

39-
ele.on('keyup', function() {
39+
ele.on('keyup change', function() {
4040
var zip = ele.val();
4141

4242
// TODO Non-US zip codes?

0 commit comments

Comments
 (0)