Why script-tags are placed at the bottom of the page in Prosilver?

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB's style.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB or modifying styles of released phpBB versions. If you need support for phpBB please visit the Support Forums on phpbb.com.

If you have questions regarding creating styles please post in Styles Support & Discussion to receive proper guidance from our staff and community.
Sectoid
Registered User
Posts: 11
Joined: Wed Sep 13, 2017 1:41 pm

Re: Why script-tags are placed at the bottom of the page in Prosilver?

Post by Sectoid » Fri Sep 15, 2017 10:59 am

hanakin wrote:
Thu Sep 14, 2017 11:49 pm
because you have no idea the skill level of the individual making the customization and weather they understand the difference between sync/async and the fact that the dom needs to be built before you can interact with it. It is safer to put it in the footer as you do not have to plan for any of this.
You may have a point but I don't have enough knowledge to understand it :) I just put my arguments here if this question brings up later:

- 99% of the browsers (if not 100%) support DOM manipulation before it's ready. Others can be handled with try-catches.
- DOM is NOT READY even if you download jQuery in the end. You still need to use ready() if you are so paranoid about DOM manipulation.
- If the jQuery were downloaded in the <head> it would give new possibilities to extension developers. It should not be a bad thing. It does not make anyone's life harder. If it does make someone's life harder somehow, please give me an example how someone could break his site.
- jQuery is a framework so it should be available as early as possible so that re-inventing the wheel would not be necessary.
- The speed advantage of not loading 35kB file in the <head> is neglible and it affects only random first time users.
- With jQuery in the <head> we could give a returning user better user experience if we wanted.

User avatar
VSE
Extension Customisations
Extension Customisations
Posts: 670
Joined: Mon Mar 08, 2010 9:18 am

Re: Why script-tags are placed at the bottom of the page in Prosilver?

Post by VSE » Sun Sep 17, 2017 7:00 am

Sectoid wrote:
Thu Sep 14, 2017 12:17 am
As long as jQuery is at the bottom I can't do what I want to do. That's why I'd like to see jQuery in the <head> in the next version of the Prosilver.
Sure you can! I don't know what you want to do, but there shouldn't be a single thing that can't be done because of whether jQuery is at the top or bottom. And if by some weird reason you can't...then don't use jQuery!! Just write some, you know, JavaScript.

It's a developers job to find a way to work within the environment they are in. Sometimes that may mean some work arounds. It does not mean, hey change the environment to make my little tweak/hack/extension/MOD easier for me to write. ;)

All the javascript code phpBB has, and all that in the hundreds of extensions, is vast...and none need jQuery to be anywhere other than where it already is.
Has an irascible disposition.

User avatar
Un1matr1x
Registered User
Posts: 48
Joined: Mon Sep 07, 2009 10:18 pm

Re: Why script-tags are placed at the bottom of the page in Prosilver?

Post by Un1matr1x » Mon Sep 18, 2017 5:54 pm

Someone with more knowledge might proof me wrong, but if you want jquery for your needs in the header, why don't you work with the events <!-- EVENT overall_footer_copyright_append --><!-- EVENT overall_footer_after --> (ugly style but with <!-- IF XYZ ...) or ask for / implement new events?

Post Reply