From: kangax on 24 Nov 2009 10:53 Stevo wrote: > David Mark wrote: >> On Nov 24, 1:57 am, Stevo <n...(a)mail.invalid> wrote: [...] >>> There is no "script X" that's >>> being hand-written by somebody and "while they're at it, why don't they >>> set a load listener". >> >> Huh? Script X is the hypothetical script that you (and Matt Kruse) >> are trying to design. It loads scripts, not with SCRIPT elements, but >> with XHR and eval. Or perhaps it will inject a SCRIPT element. >> Regardless, you will need a script to pull this off. ;) > > No. Neither of us is designing a loader script. > > We are working on "the loaded script" (the script that gets loaded by a > script loading mechanism out of our control). > > When we load, we're loading into an unknown situation and we're trying > to assess what that situation is. Have we been loaded into a fully > complete page (in which case window.onload has fired already), or are we > being loaded before window.onload has been fired. Why not check if whatever element you're trying to use is available? Maybe do some kind of polling. Ultimately, aren't you trying to detect document readiness? [...] -- kangax
From: Jorge on 24 Nov 2009 10:54 On Nov 24, 3:48 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote: > wilq wrote on 24 nov 2009 in comp.lang.javascript: > > > From what I know there is no simple way to check that. > > check what? > > [please always quote on usenet] > > > Re: Can script determine if window.onload has already fired? > > Sure, just start the onload function with > > var onloading = true; > > ans check that in your script. A local var ??? -- Jorge
From: Evertjan. on 24 Nov 2009 11:04 Jorge wrote on 24 nov 2009 in comp.lang.javascript: > On Nov 24, 3:48�pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote: >> wilq wrote on 24 nov 2009 in comp.lang.javascript: >> >> > From what I know there is no simple way to check that. >> >> check what? >> >> [please always quote on usenet] >> >> > Re: Can script determine if window.onload has already fired? >> >> Sure, just start the onload function with >> >> var onloading = true; >> >> ans check that in your script. > > A local var ??? True Declare it global first. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
From: Matt Kruse on 24 Nov 2009 15:15 On Nov 24, 12:02 am, David Mark <dmark.cins...(a)gmail.com> wrote: > On Nov 23, 11:12 pm, Matt Kruse <m...(a)thekrusefamily.com> wrote: > > 1) That depends on the first script setting an onload listener. What > > if it is loaded after window.onload? > And, pray tell, what would have loaded it after onload? For example, something like GreaseMonkey. Or any tool which injects scripts. Or perhaps a bookmarklet. Use your imagination, there are a number of cases where a script under your control is injected into a document and you have no control over the source document or when/how your code gets inserted. The ajax/eval method was just an example. Matt Kruse
From: Matt Kruse on 24 Nov 2009 15:18
On Nov 24, 1:41 am, David Mark <dmark.cins...(a)gmail.com> wrote: > On Nov 23, 3:51 pm, Matt Kruse <m...(a)thekrusefamily.com> wrote: > > Typical of this group, which is why it's become mostly irrelevant. > Typical of you, you don't know your evidence. ISTM that you have > floated the posting traffic in the jQuery group(s) as an indicator of > relative relevance. Indeed. The lower signal/noise ration in here and the fewer posts is an indicator as well. > I will assume you still subscribe to that theory, > at least up until you read the next couple of lines (then cognitive > dissonance will kick in and you will find a new belief). > Know what this is? > 4206 4167 3792 3351 2655 2904 2895 2651 2500 > 2251 1866 > The tallies for the last eleven months for the primary jQuery user > group. Last month here was 2169. The jQuery group is being moved away from Groups because of unmanageable spam. The number of readers may be reflected by this. Or perhaps jQuery is becoming so well known and documented that not as many people need help with it. How do you like them apples? :) Or perhaps jQuery popularity is fading. If that's the case, so be it. Perhaps it will be replaced by something different as the most popular scripting library. Doesn't matter to me. Matt Kruse |