javascript - Weird behaviour while inspecting chrome extension -


i have script running click on extension icon - should grab tab url, post remote server, list response. websites, working fine, other - displays first line, is, "url: blabla.com" (it still posting correctly). now, when try debug - right-click, inspect element , list (it doesnt display line "url:" though).

now question - why?

code:

 chrome.tabs.getselected(null,function(tab) {    var tablink = tab.url;     document.write("<p>"+ "url: "+ tablink +"</p>");     document.write("<p>"+ "lists: </p>");     var mydata = { url: tablink };     $.ajax(             {             url: 'http://127.0.0.1:8000/addon/',             type: "post",             data: mydata,             success: function(response){              document.write("<p>"+ "response: "+ response.id +"</p>");                 ... 

edit : fixed problem using .append() instead of document.write(), question still valid further reference - why , how "inspect element" differs regular popup-opening click...


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -