Christoph M. Becker
5/16/2015 12:03:00 AM
lazar@convexicon.com wrote:
> On Saturday, May 16, 2015 at 2:31:47 AM UTC+3, Christoph M. Becker wrote:
>
>> lazar@convexicon.com wrote:
>>
>>> "Eliminate render-blocking JavaScript and CSS in above-the-fold
>>> content Your page has 1 blocking CSS resources. This causes a delay
>>> in rendering your page."
>>
>> A blocking CSS resource? o_O
>
> Here's what I tried:
>
> $(window).load(function() {
> $('head').append('<link rel="stylesheet" href="style.css" />');
> })
If I'm not mistaken, a linked CSS resource should never block, but
rather be downloaded, parsed and applied asynchronously. That's
contrary to any client side script resources (e.g. JavaScript
resources), which have to be blocking (unless explicitly stated) due to
potentially writing to the document (e.g. document.write()).
Adding a link element on window load doesn't seem to be a good idea,
because you're risking a FOUC this way.
Anyhow, it might be best if you can post a link to the site â?? the "finer
details" might matter.
--
Christoph M. Becker