function doMyStuff(jQueryJustForThisFn) {
// do jQuery stuff!
jQueryJustForThisFn('div').addClass('wow');
}
function check() {
return window.jQuery && jQuery.fn && /^1\.[3-9]/.test(jQuery.fn.jquery);
}
if ( check() ) {
doMyStuff( jQuery );
} else {
var script = document.createElement('script'),
timer = setInterval(function(){
if ( check() ) {
clearInterval(timer);
document.body.removeChild(script);
doMyStuff( jQuery.noConflict(true) );
}
}, 30);
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js';
document.body.insertBefore( script, document.body.firstChild );
}
J-P
2009-12-29 09:11:43