The code I proposed didn't work for some reason:

++++++++++++++++++++++++

if (typeof(Prototype) === 'undefined') {
   alert('undefined');
   // put all my minified Prototype code here
}
alert('my code');
// my own code here

++++++++++++++++++++++++

This only alerted "undefined" but never alerted "my code". Anyway,
this is not a bulletproof solution because if the site owner's
Prototype loads after mine, it will still be included twice and crash
IE7.

On Jul 8, 2:39 pm, JoJo <[email protected]> wrote:
> I can do a lot of things like:
>
> if (typeof(Prototype) === 'undefined') {
>    // put all my minified Prototype code here}
>
> // my own code here
>
> But I was just wondering what you all had best experiences with.
>
> On Jul 8, 2:34 pm, Walter Lee Davis <[email protected]> wrote:
>
> > Well, can you test for the existence of Prototype.Version (look in  
> > scriptaculous.js for the exact syntax) and then error out or skip  
> > loading?
>
> > Walter
>
> > On Jul 8, 2010, at 5:02 PM, JoJo wrote:
>
> > > PROBLEM
>
> > > In IE7, many of Prototype's functions stop working when Prototype.js
> > > is included twice. What is the best practice for shielding against
> > > multiple loads of Prototype?

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to