[pmwiki-users] Annoncement: DomTT

Patrick R. Michaud pmichaud at pobox.com
Wed Aug 30 12:16:17 CDT 2006


On Wed, Aug 30, 2006 at 05:45:47PM +0100, Hans wrote:
> Wednesday, August 30, 2006, 5:17:53 PM, Hans wrote:
> 
> > I don't know why window.onload did not work, but since there are a
> > number of other scripts running, perhaps there is a conflict.
> 
> I found the conflict:
> Both Gemini and Fixflow use "onload" to recalculate sidebar height and
> main part width. Since this gets processed later it will take
> precedence over the DomTT onload function.
> 
> I am not sure how to reconcile this conflict.
> But then DomTT seems to run well without the onload.

Can you get away from using onload altogether, by putting
scripts into $HTMLFooterFmt ?  These would then be executed
at the end of loading the <body> section, without having to
disturb window.onload at all.

Another way to reconcile the conflict might be to make sure
that each onload function "chains" to the one that was previously
stored in window.onload.  (I haven't tried this.)  Thus:

    // get the previous value of window.onload, if any
    var ABCchain = window.onload;

    // store our onload function
    window.onload = ABCload;

    function ABCload() {
      // call any onload function that we replaced
      if (ABCchain) ABCOnload();

      // rest of ABC's loading here
      ...
    }

Pm




More information about the pmwiki-users mailing list