Tips & Tutorials

3 Ways To Do Case Insensitive String Comparison In Javascript

Welcome to a quick tutorial on how to do case-insensitive string comparison in Javascript. By default, the == comparison operator in Javascript is case-sensitive. Just how can we do a case-insensitive comparison in Javascript then? The common ways to do a case-insensitive string comparison in Javascript are: Change both strings to lowercase – if (FIRST.toLowerCase()

3 Ways To Do Case Insensitive String Comparison In Javascript Read More »

How To Read Files In Javascript (Simple Examples)

Welcome to a quick tutorial and examples of how to read files in Javascript. Yes, you read that right – It is possible to read files in client-side Javascript. To read a file in Javascript: Create an HTML file field – <input type=”file” id=”picker”> Get the selected file – let selected = document.getElementById(“picker”).files[0]; Read the

How To Read Files In Javascript (Simple Examples) Read More »

4 Ways To Run Javascript After Page Load (Simple Examples)

Welcome to a quick tutorial on how to run Javascript after page load. Having some trouble with missing elements, variables, or functions? Want to delay a piece of Javascript until everything else is fully loaded? The common ways to run Javascript after page load are: Add an event listener – document.addEventListener(“load”, FUNCTION); Add onload to

4 Ways To Run Javascript After Page Load (Simple Examples) Read More »