-
-
Notifications
You must be signed in to change notification settings - Fork 314
LAB inserts scripts at the beginning of the <head> #115
Comments
if you want to add the downloaded scripts to the end of the head tag .. just open LAB.src.js
in line numbers 174, 183, 190 and 244. hope it satisfies your need .. Note: this is a non tested solution . |
@xaddict why does it matter where LABjs adds the scripts? |
Well, for one, Audits by Google wants scripts in a certain place and having
|
Those audits or whatever they are, are being rather naive if they're penalizing you for dynamically added scripts in the Not sure this kind of feature would be useful to a broad enough audience to make it worth the bytes. But perhaps. |
Improved on LABjs by adding: -> conditional loading based on element availability -> test multiple elements with AND-like condition (eg: $O.test().test().js().wait()) -> test multiple elements with OR-like condition (eg: $O.test('this, that').js().wait()) -> custom javascript attributes -> leaner code (6.3kb minified, 2.9kb gzipped) -> replaces .no-js with .js on html element -> queue test via $O.queueTest() -> end() to enable explicit end of test chain without breaking the chain (unlike sandbox()) -> loading initial js (entry point js - like app.js) via data attribute with data-only -> adjusted absolute uri regex gotten from a LABjs issue (getify/LABjs#98) -> automatically load polyfill service (polyfill.io) via options -> inject script tags at end of head tag opposed to LABjs inject at top (getify/LABjs#115) -> conditional script execution of inline scripts via $O.test().script() -> add snippet in docs for lazy css since this library will not handle that -> support CommonJS (not tested)
LABjs is going to append resource requests to the end of the |
Thank you for all the work you put into this, I actively use labjs & great to see that your back to actively making it better then what it already is... |
Awesome!@getify
I know LABjs is async and deferred by design (defer the loading of LABjs and the script that calls LABjs) but PageSpeed Insights, WooRank, Feed the Bot, and other SEO tools are real bitches about order and placement of inserted scripts. For example, scripts that are before stylesheets or in order one after another (script, stylesheet, script, stylesheet) negatively impact the reports from these tools. It's very annoying but could be stopped by injecting scripts at the end of the |
LABjs insert scripts at the beginning of the instead of at the end of the or even the end of the tag. Is there a reason for this and could it be changed in upcoming versions?
The text was updated successfully, but these errors were encountered: