0

i want to do: I am using this code in different areas and some token addresses show "Failed to load resource: the server responded with a status of 422 ()" error in the development console. if it can't get data from that token address, let it detect it and prevent it from showing an error

javascript

    checkPrice();

function checkPrice() {
    $.ajax({
        url: "https://api.dex.guru/v1/tokens/0x3993453b9587e06a0e925727fd844d2d2babd39f-bsc/",
        dataType: "json",
        timeout: 30000,
        success: function(data) {
            $("#price").html("$" + data.priceUSD.toFixed(8));
            checkPrice();
        }
    });
}

html

        <div class="col text-end">
            <span id="price">-</span>
        </div>
  • https://stackoverflow.com/questions/4500741/suppress-chrome-failed-to-load-resource-messages-in-console – Quentin Oct 05 '22 at 22:57
  • TL;DR - you can't suppress the request/response from appearing in the developer console - why is it important? – Jaromanda X Oct 05 '22 at 23:15

0 Answers0