javascript - Popup window in chrome extension? -
i working chrome extension development.
here call url xml http request:
var xhr = new xmlhttprequest(); xhr.open("get", "url", true); xhr.onreadystatechange = function() { if (xhr.readystate == 4) { var resp = json.parse(xhr.responsetext); alert(resp); alert(xhr.responsetext); // innertext not let attacker inject html elements. //document.getelementbyid("resp").innertext = xhr.responsetext; } } xhr.send();
when posting same script popup window open when send request in case of chrome popup window not working.
when hit same url in browser popup window open.
please suggest me why not working in case of chrome development.
javascript alerts not working in extension popups, should avoid them. use console.log
instead.
Comments
Post a Comment