Created
September 16, 2016 19:23
-
-
Save davidalves1/5c304d18bf405eac3fae890b8ce0a00d to your computer and use it in GitHub Desktop.
Chamada CORS
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
<html> | |
<body> | |
<script> | |
window.showIP = function (resposta) { | |
// alert('O seu IP: ' + resposta.ip); | |
console.log(resposta); | |
}; | |
// este é um exemplo que funciona, mas aqui deve ser o url que queres usar | |
var src = 'https://receitaws.com.br/v1/cnpj/12345678912345?callback=showIP'; | |
var script = document.createElement('script'); | |
script.src = src; | |
document.body.appendChild(script); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment