Skip to content

Instantly share code, notes, and snippets.

@davidalves1
Created September 16, 2016 19:23
Show Gist options
  • Save davidalves1/5c304d18bf405eac3fae890b8ce0a00d to your computer and use it in GitHub Desktop.
Save davidalves1/5c304d18bf405eac3fae890b8ce0a00d to your computer and use it in GitHub Desktop.
Chamada CORS
<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