Traversy Media & Net Ninja

Page section: blog

So another go at learning JS. It’s been about 6 months.

This time round I’ve thought it would be more interesting to focus on learning the JS needed most, which for me is to work with CSS and thus accessing and manipulating DOM elements.

The Traversy Media JS Crash Course seems good because the focus is on the DOM for second, third and fourth videos. The guy has a good voice. There aren’t any exercises and since the best way of leaning is doing I try to spend about more time coding and just going back and forth from the video.

The Net Ninja

Another course I tried and think I prefer is Modern JavaScript by Net Ninja. This is a free sample of his full paid course but nevertheless involves 6 hours of Youtube tutorials in getting started with JS and encompassing ES6. This is more detailed and more in depth than the Traversy Media course.

Unfortunately the videos are not broken up into different parts.

  • 1.01.40 null and undefined.
  • 1.04.55 booleans

Site changes

I made some changes to the site. You can add <script> tags via the frontmatter with the scripts array.

---
scripts:
- /js/new.js
- /js/test-page.js
---

This now works differently than before (11.03.23). Any script, remote or local will now work provided the full path is used.

The above will add the following to the bottom of a page just above the closing </body> tag.

<script src="/js/new.js"></script>
<script src="/js/test-page.js"></script>

Seems like it’s best to do stuff in markdown because of the syntax highlighting.

I made a button shortcode button-onclick that takes 3 optional values:

  1. onclick
  2. id
  3. text (the text on the button)
<button 
  {{- with .Get "id" }}id="{{ .Get "id" }}"{{ end }} 
  {{ with .Get "onclick" }} onclick="{{ . }}"{{ end }}>
  {{ with  .Get "text "}}{{ . }}{{ end }}
</button>