{"id":2833,"date":"2016-03-18T20:50:37","date_gmt":"2016-03-18T20:50:37","guid":{"rendered":"http:\/\/musilda.cz\/?p=2833"},"modified":"2016-03-18T20:50:37","modified_gmt":"2016-03-18T20:50:37","slug":"pouziti-asynchronniho-nacitani-javascriptu-ve-wordpressu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/pouziti-asynchronniho-nacitani-javascriptu-ve-wordpressu\/","title":{"rendered":"Pou\u017eit\u00ed asynchronn\u00edho na\u010d\u00edt\u00e1n\u00ed javascriptu ve WordPressu"},"content":{"rendered":"\n
Rychlost na\u010d\u00edt\u00e1n\u00ed webu, krom\u011b jin\u00e9ho, ovliv\u0148uje na\u010d\u00edt\u00e1n\u00ed extern\u00edch javascriptov\u00fdch soubor\u016f. Ty, kter\u00e9 jsou vlo\u017eeny do hlavi\u010dky webu, jsou ozna\u010dov\u00e1ny, jako DOM blockers.<\/p>\n\n\n\n
To znamen\u00e1, \u017ee pokud prohl\u00ed\u017ee\u010d, naraz\u00ed na takov\u00fd soubor (co\u017e se mimo jin\u00e9 t\u00fdk\u00e1 i css soubor\u016f), nejprve jej na\u010dte, \u010d\u00edm\u017e se zastav\u00ed vykreslov\u00e1n\u00ed html k\u00f3du (DOMu). A\u017e po pln\u00e9m na\u010dten\u00ed js k\u00f3du, pokra\u010duje prohl\u00ed\u017ee\u010d v na\u010d\u00edt\u00e1n\u00ed.<\/p>\n\n\n\n
Mo\u017en\u00fdm \u0159e\u0161en\u00edm a tak\u00e9 \u010dasto doporu\u010dovan\u00fdm, je p\u0159esun v\u0161ech js soubor\u016f do pati\u010dky webu.<\/p>\n\n\n\n
Bohu\u017eel, toto m\u016f\u017ee m\u00edt podobn\u00fd v\u00fdsledek:<\/p>\n\n\n