Created
September 15, 2018 04:08
-
-
Save guibranco/c00b53c146bb7a902f36198dbf60c18f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON("https://viacep.com.br/ws/" + data + "/json/?callback=?", | |
function (data) { | |
if (("erro" in data)) { | |
//trata o erro | |
//errorHandler(data.erro); | |
return; | |
} | |
//usa os dados aqui | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment