javascript - Chrome Extension content script DOM not loaded -


i have trouble content script.

when oi run breakpoint work fine, without breakpoint not working properly. $(this).html(a.farewell); not update dom.

my manifest contain "run_at": "document_end"

$(function () {         $(document).ready(function () {             console.log("ready!");             var = "1";             var rows = $("tr.row");              rows.each(function (i) {                 var id = $(this).attr("data-bull-id");                 chrome.runtime.sendmessage({ getstorage: id }, function (response) {                     = response;                     console.log(response.farewell);                     $(this).html(a.farewell);                 });                  // this.innerhtml = a.test;              });               console.log("ready2!");         });       }); 

i, not sure $(this) inside sendmessage callback is. if trying access individual raw, assign $(this) variable outside callback.

by comment me, because mistake in $(this), "this" reference message not element.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -