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
This is a sub-issue of #367. The vast majority of our usage of jQuery is in the form of simple hide/show statements based on DOM elements selected by ID.
There are two ways of doing this:
Simply substitute the jQuery #selector with document.getElementById('selector').style.display = '' or 'none' respectively (this can be done with some carefully crafted regexes as a mass search and replace);
Perhaps more elegantly, have a section at the start of app.js that defines variables for each DOM element like var #selector = document.getElementById('selector'); and then substitute the jQuery selector with #selector.style.display = '' or 'none'.
The disadvantage of 2 is that it is a slower process, and a similar selector block would be needed for each file that uses jQuery methods on the DOM (e.g. app.js, uiUtli.js). But it would reduce the overall amount of code in the end. Gain compared to 1 wouldn't be noticeable in any of our supported browsers.
The text was updated successfully, but these errors were encountered:
This is a sub-issue of #367. The vast majority of our usage of jQuery is in the form of simple hide/show statements based on DOM elements selected by ID.
There are two ways of doing this:
document.getElementById('selector').style.display = ''
or'none'
respectively (this can be done with some carefully crafted regexes as a mass search and replace);var #selector = document.getElementById('selector');
and then substitute the jQuery selector with#selector.style.display = ''
or'none'
.The disadvantage of 2 is that it is a slower process, and a similar selector block would be needed for each file that uses jQuery methods on the DOM (e.g.
app.js
,uiUtli.js
). But it would reduce the overall amount of code in the end. Gain compared to 1 wouldn't be noticeable in any of our supported browsers.The text was updated successfully, but these errors were encountered: