Not executing after load, don't know why

N

noon

This code is part of a firefox extension, not that it matters, but
before you gripe over something that isn't crossbrowser compatiable,
it doesn't matter much.

It works most of the time, but not always. And fails miserably when I
right click a link --> open in new window. I have to re-refresh the
page after I do this for changes to take effect.

I've also tried getBrowser().addEventListener("onload",
this.onPageLoad, true);

Help greatly appreciated

----------------------------------------------------------------
// Event listener
window.addEventListener("load", function(e) { pi.init(); }, false);

var pi = {
init: function() {
var appcontent = document.getElementById("appcontent"); // browser
if (appcontent) {
appcontent.addEventListener("DOMContentLoaded", this.onPageLoad,
true);
}
},
onPageLoad: function(e) {
var doc = e.originalTarget; // Doc that triggered onLoad
var loc = doc.location;
( ... )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top