You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently zenphoto renders javascript near the top of the page, usually just before the </head>. Javascript belong just before the </body>, so the page doesn't remain empty while the javascript is being loaded and being parsed. Especially on mobile devices this is noticable. When corrected, a page will at least begin rendering itself before any javascript may have been loaded. This will make page loads feel faster, and make visitors happier.
Now I know very well that this is up to the theme. And it is. But does it work when I put javascript at the bottom of the page? Maybe, should be tested. And any DOMContentLoaded and/or $(function() {... or other forms of "on document loaded" events are no longer needed, because near the </body> the DOM is guaranteed to have been loaded. So, further removing complexity and potentially increasing speed.
The tricky bit is the name of the filter, and current themes and plugins registering their stuff thinking that it goes to the top. But I'm sure it can be fixed. Or you can just break compatibility - for a good reason, there's no shame in it :)
The text was updated successfully, but these errors were encountered:
Currently zenphoto renders javascript near the top of the page, usually just before the
</head>
. Javascript belong just before the</body>
, so the page doesn't remain empty while the javascript is being loaded and being parsed. Especially on mobile devices this is noticable. When corrected, a page will at least begin rendering itself before any javascript may have been loaded. This will make page loads feel faster, and make visitors happier.Now I know very well that this is up to the theme. And it is. But does it work when I put javascript at the bottom of the page? Maybe, should be tested. And any
DOMContentLoaded
and/or$(function() {...
or other forms of "on document loaded" events are no longer needed, because near the</body>
the DOM is guaranteed to have been loaded. So, further removing complexity and potentially increasing speed.The tricky bit is the name of the filter, and current themes and plugins registering their stuff thinking that it goes to the top. But I'm sure it can be fixed. Or you can just break compatibility - for a good reason, there's no shame in it :)
The text was updated successfully, but these errors were encountered: