Last active
February 26, 2019 20:55
-
-
Save jonathands/4490ef6657701a2dba88a1bebf2556d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <iframe id="estanteiframe" height="850" style="width: 100%; margin: 0; padding: 0" frameborder="0" src=""> </iframe> | |
| <script type="text/javascript"> | |
| let req = new XMLHttpRequest(); | |
| let publicServiceKey = 'CODIGODESUAESTANTE'; | |
| req.open('GET', 'https://www.businessinformativos.com.br/Services/Informativos/json?auth=' + publicServiceKey, true); | |
| req.onload = function () { | |
| if (req.status >= 200 && req.status < 400) { | |
| let jsonRev = JSON.parse(req.responseText); | |
| document.querySelector('#estanteiframe').setAttribute("src",jsonRev.infos[0].hlink) | |
| console.log(jsonRev.infos[0].hlink); | |
| } else { | |
| alert('Erro ao carregar os informativos'); | |
| } | |
| } | |
| req.send(); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment