Re: Ajile :: Re: Bad interaction between addOnload() and ajile
Thanks! Will try it out when I get a chance.
> Hi Clement,
> I took a look at your files. Thanks for taking the time to put them
> First, please download and unzip the following zip file and try it's
> The zip contains a modified version of Ajile that bypasses 1.2.1's use
> of window.onload. I also renamed some of your files and modified them
> to make use of Ajile's auto-loading functionality.
> Now that that's done, there are a few things I'd like to say:
> I'm not sure if you were simply trying to blackbox test Ajile's use of
> window.onload or if you have a legitimate scenario where the amount of
> onload switching shown in your code occurs, but my recommendation is this:
> Use window.addEventListener(...) instead of assigning handlers to the
> onload event.
> Unless your project needs to support legacy/non-DOM compliant browsers
> lacking addEvenListener support it's definitely the recommended
> approach for onload event handling.
> Ajile aims to be as cross-browser as possible and so version 1.2.1 and
> earlier attach a handler to window.onload as a fail-safe to guarantee
> script loading in legacy browsers. Your sample code is a bit involved,
> but demonstrates the kind of confusion using window.onload can cause.
> It's a great example of why addEventListener was created and is
> recommended :-)
> Ajile's next release takes a different approach to guranteed dynamic
> loading for legacy browsers and so won't use window.onload as a fail-safe.
> I hope the patched Ajile 1.2.2a meets your needs.
> Thanks again for using Ajile and for posting to this group. I'm always
> interested in feedback about Ajile.
> Good luck!