Jason Miller
519.872.0797 // developIT // Jason Miller Design
Developer of amoebaOS, Shutterborg, Delitweet & more
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-prism" group.
To post to this group, send email to mozilla-l...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-pr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-prism?hl=en.
Jason Miller
519.872.0797 // developIT // Jason Miller Design
Developer of amoebaOS, Shutterborg, Delitweet & more
var Ci = Components.interfaces;
var Cc = Components.classes;
function load() {
var wm = Cc["@mozilla.org/appshell/window-mediator;
1"].getService(Ci.nsIWindowMediator);
var mainWindow = wm.getMostRecentWindow("navigator:browser");
mainWindow.addEventListener("DOMContentLoaded", function()
{ <Your Function> }, false);
}
Hope this helps someone.
Jeremy
On Dec 15, 11:33 am, Matthew Gertner <matthew.gert...@gmail.com>
wrote:
> The problem is that the window object is the content window and not the
> browser window. So yes, it gets recreated whenever you load a new page. I
> think we probably want a new callback (e.g. pageLoad()) that is called
> whenever a new page is loaded. I actually thought someone had already filed
> a bug about this in Bugzilla, but I took a quick look and I couldn't find
> it.
>
> Matt
>
> On Sun, Dec 6, 2009 at 2:30 PM, Jannes Meyer <jannes.me...@gmail.com> wrote:
> > I'm sorry, I think you misunderstood me. I'll try to explain my problem
> > with an example.
>
> > Let's look at this code:
> > function load() {
> > window.alert("Loaded");
> > }
>
> > This gives me only one alert when* the webapp is loaded*, but i want an
> > alert everytime a *new page is loaded.
> > *How do I achieve this? I already tried this without success:
> > function load() {
> > window.onload = function() {
> > window.alert("Loaded");
> > }
> > }
>
> > Because this doesn't work I concluded that the window object obviously gets
> > recreated.
>
> > Greetings,
> > Jannes
>
> > On Sun, Dec 6, 2009 at 5:34 AM, Jason Miller <ja...@developit.ca> wrote:
>
> >> var webapp = (function(){
> >> var window;
> >> return {
> >> init : function(w) {
> >> window = w;
> >> // now you have a stored reference to the window object that seemed
> >> to become unavailable previously
> >> window.document.getElementById();
> >> }
> >> };
> >> })();
>
> >> function load() {
> >> webapp.init(window);
> >> }
>
> >> Jason Miller
> >> 519.872.0797 // developIT <http://developit.ca/> // Jason Miller Design<http://jasonmillerdesign.com/>
> >> *Developer of amoebaOS <https://amoebaos.com/>, Shutterborg<http://shutterb.org/>,
> >> Delitweet <http://delitweet.com/> & more*
> >>> mozilla-labs-pr...@googlegroups.com<mozilla-labs-prism%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/mozilla-labs-prism?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "mozilla-labs-prism" group.
> >> To post to this group, send email to mozilla-l...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> mozilla-labs-pr...@googlegroups.com<mozilla-labs-prism%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/mozilla-labs-prism?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mozilla-labs-prism" group.
> > To post to this group, send email to mozilla-l...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mozilla-labs-pr...@googlegroups.com<mozilla-labs-prism%2Bunsu...@googlegroups.com>