JSFiddle - React, Tailwind, and code Playground

by borisjavier

HTML

<form>
<input type="hidden" id="add" value="1KA7XXvhJY7M7onJSjhMELWkGhDLgNnZuQ">
<input type="hidden" id="amount" value="0.0006016">

</form><div id="results"><iframe src="https://chart.googleapis.com/chart?chs=300x300&amp;cht=qr&amp;chl=bitcoincash:1KA7XXvhJY7M7onJSjhMELWkGhDLgNnZuQ?amount=0.0006016" width="100%" height="320" frameborder="0"></iframe></div>

JavaScript

var add = document.getElementById("add");
var amo = document.getElementById("amount");
var doc = parent.document,
      theForm = doc.getElementById("report");
var i = 0;


$.ajax({
    
    dataType: "json",
    url: "https://bitek.co/test_bitbox.json",
    mimeType: "application/json",     
    type: 'GET',
    async: false,
    crossDomain: true,
    success: function() {
            var req = new XMLHttpRequest();
            req.open('GET', 'test_bitbox.json');
            req.onreadystatechange = setInterval(function() {
            if(req.readyState === 4 && req.status === 200){//
                      $('#results').html('Chao');
            } else {
                              var doIt = "";
              var json = 'test_bitbox.json';
              obje = JSON.parse(json.responseText);
              $.getJSON(req, function (data, item) {
                 $.each(item, function (index, value) {
                   $.each(value,function (ind, val) {
                       if (val==amo.value){
                          $('#results').html('hola'); 
                       }
                   });
                 });
              });
               }
            },3000);
        } 
});