Execute js on DOMContentLoaded in ff-extension

Posted by ArtWorkAD on Stack Overflow See other posts from Stack Overflow or by ArtWorkAD
Published on 2011-02-22T07:09:39Z Indexed on 2011/02/22 7:25 UTC
Read the original article Hit count: 181

Filed under:
|

Hi,

I want to enable jQuery for my extension. So I want to do something similar to

$(document).ready(function() {
   // put all your jQuery goodness in here.
 });

So I came up with

var app = window.document.getElementById('page');
app.addEventListener("DOMContentLoaded", onPageLoad, false);

function onPageLoad(){
    alert("test");
}

But this does not work at all. Any ideas how to call onPageLoad each time DOM content is reloaded?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about firefox-addon