Estoy tratando de mostrar los datos de respuesta de ajax(settings).done en el popup.html de mi extensión de Chrome. Pero no está funcionando. Sin embargo, se muestra en console.log .
manifiesto.json
{ "name": "Malware Detector", "version": "0.0.1", "manifest_version": 2, "browser_action": { "default_popup": "popup.html" }, "permissions": [ "tabs" ] }ventana emergente.html
<body> <div id="resultsDisplay"></div> <script src="cloudmersive-validate-client.js"></script> <script src="jquery-3.6.0.min.js"></script> <script src="script.js"></script> </body>guión.js
chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) { var tab = tabs[0]; // api var settings = { "url": "https://api.cloudmersive.com/virus/scan/website", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/x-www-form-urlencoded", "Apikey": "my_key_here" }, "data": { "Url": tab.url } }; $.ajax(settings).done(function (response) { console.log(response); $("#resultsDisplay").html(response); }); });