A handy little JS snippet

by Matt Johnson Jan 3rd at 11:00 AM

I needed to make sure Prototype 1.6 was present for a javascript class I was working on, so I put this at the top of my class js file:


if (Object.isUndefined(Prototype) || parseFloat(Prototype.Version) < 1.6) throw('my_class.js requires prototype.js 1.6+');

Just one simple thing I didn’t know before today.