Skip to content

Commit 56d5fa3

Browse files
authored
Merge pull request #26 from Ziptastic/fix-local-demo
Fix local demo.html.
2 parents f0d3532 + 8a40131 commit 56d5fa3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

jquery.ziptastic.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
requests[country] = {};
1919
}
2020
if(!requests[country][zip]) {
21-
requests[country][zip] = $.getJSON(location.protocol + '//zip.getziptastic.com/v2/' + country + '/' + zip);
21+
var protocol = '';
22+
if (location.protocol == 'file:') {
23+
protocol = 'https://';
24+
} else {
25+
protocol = location.protocol;
26+
}
27+
requests[country][zip] = $.getJSON(protocol + '//zip.getziptastic.com/v2/' + country + '/' + zip);
2228
}
2329

2430
// Bind to the finished request

0 commit comments

Comments
 (0)