Page 1 of 1
question about Load built-in JavaScript files asynchronously
Posted: Sun May 01, 2022 11:56 am
by wb_user
I enable Load built-in JavaScript files asynchronously in wb option
this option is very, very usable, but it has a problem with themeable menu. because themeable menu uses Jquery, and this option adds async for that.
<script src="js/jquery-3.6.0.min.js" async></script>
this is problematic because on the mobile, themeable menu does not open if you try to open the hamburger menu!
to resolve problem, i add <script src="js/jquery-3.6.0.min.js" ></script> in page heading and problem are resolve.
I think about this: can I remove async from wb created code? Or can I make an exception async for jquery-3.6.0? or is any better way to i not use two:
<script src="js/jquery-3.6.0.min.js" ></script>
<script src="js/jquery-3.6.0.min.js" async></script>
In my page?
Re: question about Load built-in JavaScript files asynchronously
Posted: Sun May 01, 2022 1:00 pm
by Pablo
If you make an exception for jQuery, then you will need an exception for many other scripts as well because most scripts depend on jQuery.
This process cannot be automated by WWB because there are too many possible combinations.
So, whether or not you can use async can only be determined by trial on error.
Re: question about Load built-in JavaScript files asynchronously
Posted: Sun May 01, 2022 1:30 pm
by wb_user
Pablo wrote: Sun May 01, 2022 1:00 pm
If you make an exception for jQuery, then you will need an exception for many other scripts as well because most scripts depend on jQuery.
This process cannot be automated by WWB because there are too many possible combinations.
So, whether or not you can use async can only be determined by trial on error.
i have ten js in my page like lottie player. can i set none-async for one of them manually?
Re: question about Load built-in JavaScript files asynchronously
Posted: Sun May 01, 2022 2:32 pm
by Pablo
I have ten js in my page like lottie player. can i set none-async for one of them manually?
No, you cannot set this option for individual scripts.
Re: question about Load built-in JavaScript files asynchronously
Posted: Sun May 01, 2022 2:56 pm
by wwonderfull
Even I used the themeable menu as its the best menu I can possible think of. Had the hamburger not working issue. It is documented in help that:
Load built-in JavaScript files asynchronously
Specifies that built-in scripts will be executed asynchronously as soon as they are available.
Note that this is only useful when 'Generate external JS file for page specific scripts' is enabled, because otherwise local scripts may be executed before the external scripts they depend on have been loaded!
So to use that stylish menu without any errors those 2 options needed to be disabled.
It is the only menu wich supports image along side and is very much themeable.
Re: question about Load built-in JavaScript files asynchronously
Posted: Mon May 02, 2022 3:30 am
by wb_user
wwonderfull wrote: Sun May 01, 2022 2:56 pm
Even I used the themeable menu as its the best menu I can possible think of. Had the hamburger not working issue. It is documented in help that:
Load built-in JavaScript files asynchronously
Specifies that built-in scripts will be executed asynchronously as soon as they are available.
Note that this is only useful when 'Generate external JS file for page specific scripts' is enabled, because otherwise local scripts may be executed before the external scripts they depend on have been loaded!
So to use that stylish menu without any errors those 2 options needed to be disabled.
It is the only menu wich supports image along side and is very much themeable.
if your mean I disable "Generate external JS file for page specific scripts'" it not possible, because I have ten js file and It is not justifiable.
one of my ideas use "notepad++" for published pages, if I cant find any better way...
Re: question about Load built-in JavaScript files asynchronously
Posted: Mon May 02, 2022 4:32 am
by wwonderfull
there are so many other manu out there which use less javascripts but that is not the problem I guess. It was more about the async on the script.