MDN Code Nuggets (5 Piece Meal)
For the past couple of weeks, I’ve been working through MDN’s Front-End Web Development course. It’s actually fairly new, and according to the release notes, was officially launched in June 2020. I was looking for a resource like this mainly to improve existing skills, and to see what new things I could learn from fundamental topics.
Having worked in the industry for 1+ years now, it’s enjoyable to read the documentation like this without being concerned about working on anything, and just focusing on studying and a bit of simple application. Here are some fundamental nuggets that I found.
Nugget #1
When creating a link where a resource will be downloaded rather than opened in the browser, you can use the ‘download’ attribute — this gives the file a default filename when someone goes to download it.
Nugget #2
When creating email links, you can additionally specify default values for mail header fields – i.e. CC, BCC, Subject, and Body.
Nugget #3
Script Loading Strategy: When applying JavaScript to HTML, you can use the ‘defer’ attribute to make sure the HTML is all loaded before the JavaScript runs to prevent errors.
Nugget #4
You can use the ‘abbr‘ element in HTML to represent both abbreviations and acronyms. A tooltip appears when the term is hovered over.
Nugget #5
You can wrap text using the ‘q’ element to render quotation marks in the browser.
Jashele is a Web Developer in Phoenix, Arizona with a passion for creating and learning new things. Her previous experience includes working as an Email Developer for meltmedia (yeah, lower-case ‘m’) and as a Software Developer Specialist for Maricopa Community College. You can keep up with Jashele’s tech journey by visiting her website, following her on Twitter, or subscribing to her Youtube channel.