javascript - The popup is keep appending html code when webpage is currently loading -
i'm building chrome browser extension, extension read , parse loaded page, microdata , turn informative.
for now, extension work if page loaded perfectly.
image: 
but, if page still loading (even if loading on other tab), , happen click extension, popup continue display it's html code (i'm using jquery append html code popup area).
image: 
snippet of how html displayed:
chrome.extension.onmessage.addlistener(function(request, sender, sendresponse) { if ($(".loading").is(":visible")) { $(".loading").hide(); } $('.messi-titlebox').append(judul); // handler if no microdata if (nama == "makan") { $('.messi-titlebox').append(gaada); } else { $('.messi-titlebox').append(tabel + '<tr>' + tabelgambar + sisatabel + '</tr></table>'); $('.messi-titlebox').append(telusuri); } $.getjson(geocodingapi, function (json) { var murah = 0; jquery("#gambar1").attr('src', json[0].picture ); jquery("#gambar2").attr('src', json[1].picture ); jquery("#gambar3").attr('src', json[2].picture ); }); }); is there anyway how fix this, while webpage still loading, popup not append continuously? thanks
Comments
Post a Comment