Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMICHAEL STEVENSON
243 PointsIf you're loading the function last, wouldn't the warning message be shown until the Jquery function is ran to hide it?
Since the DOM is loading before the JS files, that warning message is going to show until the scripts are ran, right? So the warning class should be hidden by default I would imagine. Is that as simple as giving it a display:none as a default in the css?
1 Answer
Chris Shaw
26,676 PointsThat's correct, however it will come down to how large your HTML document is overall as the larger it is, the longer it will take the browser to render it. If you have a fairly small document, something along the lines of 30Kbs with a small JavaScript file you shouldn't see the element in modern browsers (IE10+, Chrome etc.) as they have remarkable fast engines.
If you want to be on the safe side using CSS can be a much better option but depending on your accessibility requirements you will need to be careful as a property such as display
with a value of none
will cause the element to become invisible to screen readers.
Hope that helps.