What is jQuery?
(skip this if you already know)
jQuery is a JavaScript library that greatly simplifies DOM scripting by providing CSS selectors to access DOM elements. For example:
Code: Select all
$('div.login-form input[type=submit]').click(function() {
$(this).hide();
});
Proposal
It would be very useful to have jQuery included in the phpBB 3.x core. Other libraries can be considered, however jQuery is likely the most popular.
What's in it for phpBB
In many places it may be possible to rewrite existing JS code to use jQuery, simplifying it to a great extent. This makes the code a lot more maintainable.
What's in it for MODs
There is at least one MOD that uses jQuery. If several MODs do this they create a conflict. By making jQuery available directly, such issues are avoided. Because it makes almost any DOM development a lot easier, it's use should be strongly encouraged for any MODs that touch JavaScript.
Keep in mind
- Performance
jQuery does add additional load to the page in different ways. Also, while jQuery is really convenient, there are things that need to be done to make it perform, such as caching matched elements. Some information here. - Distribution/Packaging
When adding third party libraries to phpBB, these need to be maintained. Each minor release should update jQuery to the latest version. Security issues in jQuery should result in a PL (patch level) release. - Alternatives
Are there any alternative libraries that can be considered? Dojo, prototype, others?