I'm developing an extension and creating a popup type window.
chrome.windows.create({  
        url: "../html/dialog.html",  
        width: 400,  
        height: 200,
        focused: true,
        type: "popup"
    }, function(){
        //callback
    });
In the callback, I want to change the content of the page, add text and images, using JQuery, so what I would normally do is:
$('#dialog_content').html("hello!");
Having a div in my dialog.html document:
<div id="dialog_content"></div>
But aparentally the callback is called before the page content is loaded, so $('#dialog_content') doesn't exist yet.
I tried to use
$('#dialog_content').load(function () {
    $('#dialog_content').html("hello!");
});
but it doesn't work, the event is not called.
Is there any other way I can do it?
Thanks.
(ps: JQuery is included in background)
 
    