He wrote in the English version of the site, after which he got here, who did not understand the question, sorry.
I create a Javascript structure resembling a Sandbox Core and modules (in my case with the IIFE structure). I like the idea of connecting scripts inside scripts (like the analogy include or required). I am connecting the script via XMLHttpRequest and eval:
var transport = js.getXHTTPTransport(); // my function transport.open('GET', js.pathToUrl(path, version), false); transport.send(null); I see downloaded scripts, you can see them in the Network tab of the debugger, but there is a warning:
Synchronous XMLHttpRequest on the main thread is deprecated
Can you advise:
- Is this a normal way to connect scripts in this way, so to speak, taking into account modern frameworks and plugins (I don’t want to use a separate library like RequireJS) just for the connection function? And will it affect the page loading speed? There are many examples, but it’s not clear to me whether this is a good / normal practice of such a "shadow" connection and whether it affects the page. For me, this is the convenience of connecting the necessary libraries, precisely within a specific file: https://www.safaribooksonline.com/library/view/even-faster-web/9780596803773/ch04.html
- Is it possible to get rid of warning and is it significant? All the same, a warning is a warning, not really Camille, or is it better to connect scripts by the same script tag injection on the page? Last, I somehow do not really like it.
Thanks for the help.
falsein theopenmethod withtrue- Grundyjs.include('libraries/jquery/jquery-1.11.3.min');), the library does not work asynchronously. I understand that everything happens at different times and something is loaded before the other. With a value offalseeverything happens "by script", but causes a warning. Is setTimeout correct in this case? - Kirill Malyarenko 6:55