Skip to content

Commit

Permalink
Merge pull request #26 from Ziptastic/fix-local-demo
Browse files Browse the repository at this point in the history
Fix local demo.html.
  • Loading branch information
bfranco94 authored Jun 18, 2016
2 parents f0d3532 + 8a40131 commit 56d5fa3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jquery.ziptastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
requests[country] = {};
}
if(!requests[country][zip]) {
requests[country][zip] = $.getJSON(location.protocol + '//zip.getziptastic.com/v2/' + country + '/' + zip);
var protocol = '';
if (location.protocol == 'file:') {
protocol = 'https://';
} else {
protocol = location.protocol;
}
requests[country][zip] = $.getJSON(protocol + '//zip.getziptastic.com/v2/' + country + '/' + zip);
}

// Bind to the finished request
Expand Down

0 comments on commit 56d5fa3

Please sign in to comment.