onymos-logo
< Onymos Blog

MDN Code Nuggets (5 Piece Meal)

MDN Code Nuggets

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.

Download tag gif.
Check out the full article on MDN

Nugget #2

When creating email links, you can additionally specify default values for mail header fields – i.e. CC, BCC, Subject, and Body.

Email default values gif.
Check out the full article on MDN

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.

JS defer gif.
Check out the full article on MDN

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.

Abbreviations for acronyms gif.
Check out the full article on MDN

Nugget #5

You can wrap text using the ‘q’ element to render quotation marks in the browser.

Q tag gif.
Check out the full article on MDN

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.   

Ask us if we've already built the solution you need

Building new apps from scratch is a waste of your developers’ time and skills. Get core features your app needs now — because we already built them for you.

Talk to an expert

We know app dev

What does the latest iOS release tell us about Apple’s strategy? Does tech have an innovation problem? Is your team ready for a passwordless future? Subscribe to our blog for:

  • Trends in app development
  • Research reports
  • Demo videos and more

Subscribe to the Onymos blog

Overlay