obtener datos Json (Mostrando error: 'La solicitud no se ejecutó') Cómo hacer que se ejecute un código de solicitud.
país.js
$("#btn-id").click(function() { //get data $.getJSON("https://reqres.in/api/users?page=2", function(json) { //Empty div if clicked agian $("#data-id").html('') //loop through it json.data.forEach(function(jd) { //append data in div $("#data-id").append(jd.id + "--" + jd.email + '<br>'); }) }); });ARCHIVO HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>The jQuery Example</title> <script src="country.js"></script> </head> <body> <form> <input type="button" id ="btn-id" value = "Click to Load Data" /> <div id="data-id"></div> </form> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="country.js"></script> </body> </html>obtener datos Json (Mostrando error: 'La solicitud no se ejecutó') Cómo hacer que se ejecute un código de solicitud.