the code actually prefers to listen to the domcontentloaded event;
if(window.addEventListener){
window.addEventListener('DOMContentLoaded',deferredCSS,false);
}else{
window.onload = deferredCSS;
}
But I guess the same problem applies? Does Cloudflare suggest another event to tie into for this purpose?
frank
I don’t think, it is supposed to emulate window events normally but apparently it has a lot of quirks
In that case maybe you’d better log a ticket at Cloudflare’s instead, no? 🙂
frank
Hi natostanco,
CloudFlare is great; but Rocket Loader… not so much.
Rocket Loader only ‘works’ in select browsers; is not recognized by Google Bot; will (almost always) degrade page-to-page navigation/transition load times (since the browser is unable to cache RocketScript .JS); is still in BETA (will work one day, not the next); and is, at least for dynamic WordPress sites, a ‘hammer’ instead of ‘scalpel’ — it’s pretty much all-or-nothing, on or off, unless you know PHP backwards and forwards.
Ideally, you’ll want to make use of Frank’s plugin to defer/asynchronously load your JavaScript. Then, of course, deferred CSS will load properly. (Not to mention all of the other benefits of utilizing ‘universally’ recognized HTML 5 script attributes).
Best,
AJ