Are you over 18 and want to see adult content?
More Annotations
A complete backup of myfridgefood.com
Are you over 18 and want to see adult content?
A complete backup of irvingtreeservice.com
Are you over 18 and want to see adult content?
A complete backup of meskerparkzoo.com
Are you over 18 and want to see adult content?
A complete backup of freebetsinfo.co.uk
Are you over 18 and want to see adult content?
A complete backup of jumpinjammerz.com
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of www.amarujala.com/india-news/3350-tonne-goldmine-found-sonbhadra-up-5-times-indian-gold-reserve-what-it-mea
Are you over 18 and want to see adult content?
A complete backup of www.handelsblatt.com/finanzen/maerkte/marktberichte/dow-jones-nasdaq-sundp-500-corona-sorgen-belasten-us-ma
Are you over 18 and want to see adult content?
A complete backup of timesofindia.indiatimes.com/entertainment/hindi/bollywood/news/shamita-shetty-welcomes-shilpas-newborn-daug
Are you over 18 and want to see adult content?
A complete backup of navbharattimes.indiatimes.com/sports/cricket/india-in-new-zealand/india-vs-new-zealand-first-test-day-1-mat
Are you over 18 and want to see adult content?
A complete backup of nos.nl/l/2323884
Are you over 18 and want to see adult content?
A complete backup of www.jansatta.com/entertainment/television/indian-idol-11-grand-finale-winner-live-updates-grand-finale-adit
Are you over 18 and want to see adult content?
A complete backup of www.kp.ru/daily/27095/4168670/
Are you over 18 and want to see adult content?
Text
other choice.
HOW TO TURN ANY GITHUB REPO INTO A CDN I’ve already added instructions on this to Atomic, Validate, and Smooth Scroll, and will be updating the docs for my other plugins as well.. But where this really shines is for use with other peoples’ OSS projects when a CDN isn’t provided but you need a quick and easyway to
DEBOUNCING YOUR JAVASCRIPT EVENTS Debouncing is a way of forcing a function to wait a certain period of time before running again. Why would you want to do that? JavaScript events like scroll and resize can cause huge performance issues on certain browsers. Paul Irish explains: If you’ve ever attached an event handler to the window’s resize event, you have probably noticed that while Firefox fires the event slow and HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. FIXING SAFARI'S BACK BUTTON BROWSER CACHE ISSUE WITH Safari has a weird “quirk.” If you navigate from one page to another in a web app, and then click the back button, Safari loads the entire previous view as a cached version of it’s previous state rather than refreshing the content. Here’s a demo. Download the files, then open 1.index in Safari. Click the Next Page link, then use the browser’s back button to go back. HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on ONLY ALLOWING ONE OPEN DROPDOWN AT A TIME WITH THE DETAILS If the clicked element isn’t open, we’ll do nothing.. Otherwise, we’ll get all of the open dropdowns in our nav element, and close them by removing the attribute. We’ll check that the item isn’t the one we just opened first, though. HOW TO COPY OR CLONE AN ELEMENT WITH VANILLA JS Today, I’m going to show you how to grab an existing element in the DOM and make an exact copy of it that you can manipulate however you want. An example To make this tangible, let’s imagine you have an element with an ID of #elem1 and a class of .bg-blue. This node has some content. We want to make a copy of it, update the ID, add a . HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH About; Daily Tips; Learn JS; Search; Made with ️ in Massachusetts. Unless otherwise noted, all code is free to use under the MIT License.I also very irregularly share non-coding thoughts.thoughts. HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
HOW TO TURN ANY GITHUB REPO INTO A CDN I’ve already added instructions on this to Atomic, Validate, and Smooth Scroll, and will be updating the docs for my other plugins as well.. But where this really shines is for use with other peoples’ OSS projects when a CDN isn’t provided but you need a quick and easyway to
DEBOUNCING YOUR JAVASCRIPT EVENTS Debouncing is a way of forcing a function to wait a certain period of time before running again. Why would you want to do that? JavaScript events like scroll and resize can cause huge performance issues on certain browsers. Paul Irish explains: If you’ve ever attached an event handler to the window’s resize event, you have probably noticed that while Firefox fires the event slow and HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. FIXING SAFARI'S BACK BUTTON BROWSER CACHE ISSUE WITH Safari has a weird “quirk.” If you navigate from one page to another in a web app, and then click the back button, Safari loads the entire previous view as a cached version of it’s previous state rather than refreshing the content. Here’s a demo. Download the files, then open 1.index in Safari. Click the Next Page link, then use the browser’s back button to go back. A COMPLETE GUIDE TO ACCESSIBLE FRONT END COMPONENTS In a complete guide to accessible front-end components, Vitaly Friedman from Smashing Magazine collected a trove of information and related articles on the various components we use to build web things and how to make them accessible. From the basics like :focus styles, buttons, and links to more advanced components like data charts, comics, and modal windows, there’s a ton of good stuff here! HOW TO USE THE FETCH API WITH VANILLA JS The Fetch API is used to make Ajax requests, such as calling an API or fetching a remote resource or HTML file from a server. In the past, I’ve been very vocal about my preference for XHR over Fetch. I was wrong. Fetch is objectively superior. It does everything I need it to with a simpler syntax. Let’s look at how it works. The Basic Fetch API Syntax For today’s article, we’ll use HOW TO COPY OR CLONE AN ELEMENT WITH VANILLA JS Today, I’m going to show you how to grab an existing element in the DOM and make an exact copy of it that you can manipulate however you want. An example To make this tangible, let’s imagine you have an element with an ID of #elem1 and a class of .bg-blue. This node has some content. We want to make a copy of it, update the ID, add a . HOW TO TURN ANY GITHUB REPO INTO A CDN I’ve already added instructions on this to Atomic, Validate, and Smooth Scroll, and will be updating the docs for my other plugins as well.. But where this really shines is for use with other peoples’ OSS projects when a CDN isn’t provided but you need a quick and easyway to
HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes and FORMATTING DATES WITH VANILLA JS Today, I want to teach you how to take a timestamp and convert it into a formatted date. Valid timestamps Before we get started, there are two valid timestamp formats we can use for this First, we can use a unix timestamp, which is the time in milliseconds that has elapsed since January 1, 1970. For example here’s July 4, 2018 represented as a unix timestamp: 1530680400000. HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
HOW TO IMMEDIATELY ACTIVATE A SERVICE WORKER WITH VANILLA August 21, 2020 How to immediately activate a service worker with vanilla JS You’ve written your first service worker and are saving pages for offline viewing as the user visits them.Maybe you’ve loading your web fonts from a service worker cache, too, for better performance.. You visit your site for the first time, click a few pages, go offline, and nothing. HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on ONLY ALLOWING ONE OPEN DROPDOWN AT A TIME WITH THE DETAILS This event fires on a element when it’s opened or closed. This event doesn’t bubble, so you’ll need to set useCapture to true. If the clicked element isn’t open, we’ll do nothing. Otherwise, we’ll get all of the open dropdowns in our nav element, and close them by HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! HOW TO COPY OR CLONE AN ELEMENT WITH VANILLA JS Today, I’m going to show you how to grab an existing element in the DOM and make an exact copy of it that you can manipulate however you want. An example To make this tangible, let’s imagine you have an element with an ID of #elem1 and a class of .bg-blue. This node has some content. We want to make a copy of it, update the ID, add a . HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
DEBOUNCING YOUR JAVASCRIPT EVENTS Debouncing is a way of forcing a function to wait a certain period of time before running again. Why would you want to do that? JavaScript events like scroll and resize can cause huge performance issues on certain browsers. Paul Irish explains: If you’ve ever attached an event handler to the window’s resize event, you have probably noticed that while Firefox fires the event slow and FIXING SAFARI'S BACK BUTTON BROWSER CACHE ISSUE WITH Safari has a weird “quirk.” If you navigate from one page to another in a web app, and then click the back button, Safari loads the entire previous view as a cached version of it’s previous state rather than refreshing the content. Here’s a demo. Download the files, then open 1.index in Safari. Click the Next Page link, then use the browser’s back button to go back. HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on ONLY ALLOWING ONE OPEN DROPDOWN AT A TIME WITH THE DETAILS This event fires on a element when it’s opened or closed. This event doesn’t bubble, so you’ll need to set useCapture to true. If the clicked element isn’t open, we’ll do nothing. Otherwise, we’ll get all of the open dropdowns in our nav element, and close them by HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! HOW TO COPY OR CLONE AN ELEMENT WITH VANILLA JS Today, I’m going to show you how to grab an existing element in the DOM and make an exact copy of it that you can manipulate however you want. An example To make this tangible, let’s imagine you have an element with an ID of #elem1 and a class of .bg-blue. This node has some content. We want to make a copy of it, update the ID, add a . HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
DEBOUNCING YOUR JAVASCRIPT EVENTS Debouncing is a way of forcing a function to wait a certain period of time before running again. Why would you want to do that? JavaScript events like scroll and resize can cause huge performance issues on certain browsers. Paul Irish explains: If you’ve ever attached an event handler to the window’s resize event, you have probably noticed that while Firefox fires the event slow and FIXING SAFARI'S BACK BUTTON BROWSER CACHE ISSUE WITH Safari has a weird “quirk.” If you navigate from one page to another in a web app, and then click the back button, Safari loads the entire previous view as a cached version of it’s previous state rather than refreshing the content. Here’s a demo. Download the files, then open 1.index in Safari. Click the Next Page link, then use the browser’s back button to go back. A COMPLETE GUIDE TO ACCESSIBLE FRONT END COMPONENTS In a complete guide to accessible front-end components, Vitaly Friedman from Smashing Magazine collected a trove of information and related articles on the various components we use to build web things and how to make them accessible. From the basics like :focus styles, buttons, and links to more advanced components like data charts, comics, and modal windows, there’s a ton of good stuff here! HOW TO USE THE FETCH API WITH VANILLA JS The Fetch API is used to make Ajax requests, such as calling an API or fetching a remote resource or HTML file from a server. In the past, I’ve been very vocal about my preference for XHR over Fetch. I was wrong. Fetch is objectively superior. It does everything I need it to with a simpler syntax. Let’s look at how it works. The Basic Fetch API Syntax For today’s article, we’ll use HOW TO COPY OR CLONE AN ELEMENT WITH VANILLA JS Today, I’m going to show you how to grab an existing element in the DOM and make an exact copy of it that you can manipulate however you want. An example To make this tangible, let’s imagine you have an element with an ID of #elem1 and a class of .bg-blue. This node has some content. We want to make a copy of it, update the ID, add a . HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property HOW TO TURN ANY GITHUB REPO INTO A CDN I’ve already added instructions on this to Atomic, Validate, and Smooth Scroll, and will be updating the docs for my other plugins as well.. But where this really shines is for use with other peoples’ OSS projects when a CDN isn’t provided but you need a quick and easyway to
HOW TO IMMEDIATELY ACTIVATE A SERVICE WORKER WITH VANILLA August 21, 2020 How to immediately activate a service worker with vanilla JS You’ve written your first service worker and are saving pages for offline viewing as the user visits them.Maybe you’ve loading your web fonts from a service worker cache, too, for better performance.. You visit your site for the first time, click a few pages, go offline, and nothing. ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes and FORMATTING DATES WITH VANILLA JS Today, I want to teach you how to take a timestamp and convert it into a formatted date. Valid timestamps Before we get started, there are two valid timestamp formats we can use for this First, we can use a unix timestamp, which is the time in milliseconds that has elapsed since January 1, 1970. For example here’s July 4, 2018 represented as a unix timestamp: 1530680400000. STATE BASED UI VS. MANUAL DOM MANIPULATION State-Based UI #. With a state-based UI approach, you store all of the data in a JavaScript object. For our list-making app, it might look like this. Then, you use JavaScript to build the DOM based on the current data state. If the data.listItems property has no items, maybe you show a message inviting the user to create their first item. HOW TO DETECT WHEN THE BROWSER URL CHANGES WITH VANILLA JS Yesterday, we looked at how to update the browser URL without refreshing the page using the history.pushState() method. Today, let’s look how to detect when the URL changes and do things as a result. The popstate event If you use history.pushState() to update the URL, when the user clicks the forward or backward buttons, the URL will change but the UI will not. HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! LISTENING FOR CLICK EVENTS WITH VANILLA JAVASCRIPT jQuery makes listening for click events really easy. If you want to, for example, detect any time an element with the class .click-me is clicked, you would do this. $('.click-me').click(function (event) { // Don't follow the link event.preventDefault(); // Log the clicked element in the console console.log(event.target); }); Luckily, vanilla JavaScript makes it just as easy thanks to the ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes and HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
USING FLUIDVIDS.JS
KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
WHEN DO YOU USE NEW JAVASCRIPT FEATURES VS. OLD APPROACHESSEE MORE ONGOMAKETHINGS.COM
JAVASCRIPT SELECTOR PERFORMANCE One of the students in my Vanilla JS Slack channel asked me about the performance difference between querySelector() and things like getElementById() and getElementsByClassName(). Specifically, getElementById() and getElementsByClassName() are more than twice as fast as querySelector() and querySelectorAll(). So, that’s bad, right? I honestly don’t think it matters. DETECTING WHEN A VISITOR HAS STOPPED SCROLLING WITHJAVASCRIPT SETTIMEOUT FUNCTION WITH PARAME… For one of my open source projects, I was recently asked if there’s a way to delay running something until after scrolling has finished. There’s no native JavaScript event for when scrolling stops, but it is something you can detect pretty easily with just a few lines of code. The Approach We want to listen for scroll events usingaddEventListener.
HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! LISTENING FOR CLICK EVENTS WITH VANILLA JAVASCRIPT jQuery makes listening for click events really easy. If you want to, for example, detect any time an element with the class .click-me is clicked, you would do this. $('.click-me').click(function (event) { // Don't follow the link event.preventDefault(); // Log the clicked element in the console console.log(event.target); }); Luckily, vanilla JavaScript makes it just as easy thanks to the ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes and HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
USING FLUIDVIDS.JS
KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
WHEN DO YOU USE NEW JAVASCRIPT FEATURES VS. OLD APPROACHESSEE MORE ONGOMAKETHINGS.COM
JAVASCRIPT SELECTOR PERFORMANCE One of the students in my Vanilla JS Slack channel asked me about the performance difference between querySelector() and things like getElementById() and getElementsByClassName(). Specifically, getElementById() and getElementsByClassName() are more than twice as fast as querySelector() and querySelectorAll(). So, that’s bad, right? I honestly don’t think it matters. DETECTING WHEN A VISITOR HAS STOPPED SCROLLING WITHJAVASCRIPT SETTIMEOUT FUNCTION WITH PARAME… For one of my open source projects, I was recently asked if there’s a way to delay running something until after scrolling has finished. There’s no native JavaScript event for when scrolling stops, but it is something you can detect pretty easily with just a few lines of code. The Approach We want to listen for scroll events usingaddEventListener.
A COMPLETE GUIDE TO ACCESSIBLE FRONT END COMPONENTS In a complete guide to accessible front-end components, Vitaly Friedman from Smashing Magazine collected a trove of information and related articles on the various components we use to build web things and how to make them accessible. From the basics like :focus styles, buttons, and links to more advanced components like data charts, comics, and modal windows, there’s a ton of good stuff here! HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on THE MOBILE WEB IS THE WEB Yesterday, Laurie Voss tweeted about the latest Nielsen Total Audience Report, noting: I knew that mobile web overtook desktop web in 2014, but TIL in 2020 US consumers spent 88% of their internet time on mobile devices. Forget mobile-first, it’s nearly mobile-only. WOW! I’m sure the global pandemic played a roll in those numbers to some extent, but this has a big impact on how we build ARROW FUNCTIONS IN VANILLA JS Arrow functions were introduced to JavaScript in ES6. Their intent was to provide a shorter syntax for writing functions and eliminate some of the confusion that exists around this. Because they look so dramatically different from traditional functions, though, they often make scripts more confusing. However, more and more scripts and tutorials are being written with arrow functions, so it’s LEARNING HOW TO THINK IN JAVASCRIPT One of the biggest challenges about learning JavaScript that I hear from students is that they struggle to think in JavaScript. They’ve may have learned about the different methods and browser APIs you can use, but have trouble knowing how to combine them into a working script, especially when starting from scratch. This is really common. I went through it to, when I was learning. TOOLS AND DEVELOPER HABITS One of my biggest concerns with the widespread use of frameworks and libraries is the bad habits they create among the developer population (and in particular, the next generation of developers). Let’s dig in. Event handling in a framework-obsessed world Yesterday, I learned that adding an event listener as an on* event on an element in React gets converted into event delegation under-the-hood. HOW TO USE THE FETCH API WITH VANILLA JS The Fetch API is used to make Ajax requests, such as calling an API or fetching a remote resource or HTML file from a server. In the past, I’ve been very vocal about my preference for XHR over Fetch. I was wrong. Fetch is objectively superior. It does everything I need it to with a simpler syntax. Let’s look at how it works. The Basic Fetch API Syntax For today’s article, we’ll use HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property HOW TO ANIMATE SCROLLING TO ANCHOR LINKS WITH ONE LINE OF The scroll-behavior property tells the browser how to handle scrolling to anchor links within an element. The default value, auto, does a hard jump like you’re used to. A value of scroll tells the browser to animate scrolling. There’s no way to specify easing, but it ties into the browser’s refresh rate to give you silky smooth animations. DEBOUNCING YOUR JAVASCRIPT EVENTS Debouncing is a way of forcing a function to wait a certain period of time before running again. Why would you want to do that? JavaScript events like scroll and resize can cause huge performance issues on certain browsers. Paul Irish explains: If you’ve ever attached an event handler to the window’s resize event, you have probably noticed that while Firefox fires the event slow and HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
LISTENING FOR CLICK EVENTS WITH VANILLA JAVASCRIPT jQuery makes listening for click events really easy. If you want to, for example, detect any time an element with the class .click-me is clicked, you would do this. $('.click-me').click(function (event) { // Don't follow the link event.preventDefault(); // Log the clicked element in the console console.log(event.target); }); Luckily, vanilla JavaScript makes it just as easy thanks to the ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes andUSING FLUIDVIDS.JS
KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
WHEN DO YOU USE NEW JAVASCRIPT FEATURES VS. OLD APPROACHESSEE MORE ONGOMAKETHINGS.COM
JAVASCRIPT SELECTOR PERFORMANCE One of the students in my Vanilla JS Slack channel asked me about the performance difference between querySelector() and things like getElementById() and getElementsByClassName(). Specifically, getElementById() and getElementsByClassName() are more than twice as fast as querySelector() and querySelectorAll(). So, that’s bad, right? I honestly don’t think it matters. DETECTING WHEN A VISITOR HAS STOPPED SCROLLING WITHJAVASCRIPT SETTIMEOUT FUNCTION WITH PARAME… For one of my open source projects, I was recently asked if there’s a way to delay running something until after scrolling has finished. There’s no native JavaScript event for when scrolling stops, but it is something you can detect pretty easily with just a few lines of code. The Approach We want to listen for scroll events usingaddEventListener.
HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on HOW TO CLEAR ALL OF THE FIELDS IN A FORM WITH VANILLA JS The HTMLFormElement.reset() method resets all fields in a form back to their default values. This means that if you had a specified value property on a field, and the user changed it, it would revert to the original instead of emptying completely.. Here’s a demo. The HTMLFormElement.reset() method works in all modern browsers, and IE9 and above.. 🚀 Last chance to join! HOW AND WHY TO LEARN COMMAND LINE AS A FRONT END DEVELOPER When I was hired for my first front end developer job, I had no idea how to use the command line. Many of the tools used by the team I was part of required using command line. I couldn’t get my working environment setup for our code base without it. And so, that’s how I learned command line: reluctantly thrown into it because I had noother choice.
LISTENING FOR CLICK EVENTS WITH VANILLA JAVASCRIPT jQuery makes listening for click events really easy. If you want to, for example, detect any time an element with the class .click-me is clicked, you would do this. $('.click-me').click(function (event) { // Don't follow the link event.preventDefault(); // Log the clicked element in the console console.log(event.target); }); Luckily, vanilla JavaScript makes it just as easy thanks to the ADDING A NEW ELEMENT TO THE DOM WITH VANILLA JS Yesterday, we looked at how to add markup to an element with vanilla JavaScript. As a follow-up, one of the students in my Vanilla JS Slack channel asked me how to inject a new element into the DOM with JavaScript. We can do this using the createElement() method, which let’s us, as the name implies, create a new element. This is a fully manipulatable DOM node, and we can add classes andUSING FLUIDVIDS.JS
KEEPING CREDENTIALS SECURE WHEN MAKING API CALLS WITH Keeping credentials secure when making API calls with JavaScript. This is an excerpt from my APIs with Vanilla JS pocket guide. Some APIs—like the Ron Swanson Quotes Generator and Random Dog —work by simply calling an endpoint. Others—like the New York Times and many endpoints for the GitHub API —require you to authenticate who youare
WHEN DO YOU USE NEW JAVASCRIPT FEATURES VS. OLD APPROACHESSEE MORE ONGOMAKETHINGS.COM
JAVASCRIPT SELECTOR PERFORMANCE One of the students in my Vanilla JS Slack channel asked me about the performance difference between querySelector() and things like getElementById() and getElementsByClassName(). Specifically, getElementById() and getElementsByClassName() are more than twice as fast as querySelector() and querySelectorAll(). So, that’s bad, right? I honestly don’t think it matters. DETECTING WHEN A VISITOR HAS STOPPED SCROLLING WITHJAVASCRIPT SETTIMEOUT FUNCTION WITH PARAME… For one of my open source projects, I was recently asked if there’s a way to delay running something until after scrolling has finished. There’s no native JavaScript event for when scrolling stops, but it is something you can detect pretty easily with just a few lines of code. The Approach We want to listen for scroll events usingaddEventListener.
A COMPLETE GUIDE TO ACCESSIBLE FRONT END COMPONENTS In a complete guide to accessible front-end components, Vitaly Friedman from Smashing Magazine collected a trove of information and related articles on the various components we use to build web things and how to make them accessible. From the basics like :focus styles, buttons, and links to more advanced components like data charts, comics, and modal windows, there’s a ton of good stuff here! HOW TO AUTOPLAY VIDEOS AFTER A MODAL OPENS The first thing we want to do is get our video. We’ll use querySelector() to search inside the modal.. querySelector() lets you pass in multiple selectors, separated by a comma, and will grab the first matching element. We’ll looking for iframes with either YouTube or Vimeo in the src, as well as video elements.. If the modal doesn’t have a matching video, we’ll call return to bail on THE MOBILE WEB IS THE WEB Yesterday, Laurie Voss tweeted about the latest Nielsen Total Audience Report, noting: I knew that mobile web overtook desktop web in 2014, but TIL in 2020 US consumers spent 88% of their internet time on mobile devices. Forget mobile-first, it’s nearly mobile-only. WOW! I’m sure the global pandemic played a roll in those numbers to some extent, but this has a big impact on how we build ARROW FUNCTIONS IN VANILLA JS Arrow functions were introduced to JavaScript in ES6. Their intent was to provide a shorter syntax for writing functions and eliminate some of the confusion that exists around this. Because they look so dramatically different from traditional functions, though, they often make scripts more confusing. However, more and more scripts and tutorials are being written with arrow functions, so it’s LEARNING HOW TO THINK IN JAVASCRIPT One of the biggest challenges about learning JavaScript that I hear from students is that they struggle to think in JavaScript. They’ve may have learned about the different methods and browser APIs you can use, but have trouble knowing how to combine them into a working script, especially when starting from scratch. This is really common. I went through it to, when I was learning. TOOLS AND DEVELOPER HABITS One of my biggest concerns with the widespread use of frameworks and libraries is the bad habits they create among the developer population (and in particular, the next generation of developers). Let’s dig in. Event handling in a framework-obsessed world Yesterday, I learned that adding an event listener as an on* event on an element in React gets converted into event delegation under-the-hood. HOW TO USE THE FETCH API WITH VANILLA JS The Fetch API is used to make Ajax requests, such as calling an API or fetching a remote resource or HTML file from a server. In the past, I’ve been very vocal about my preference for XHR over Fetch. I was wrong. Fetch is objectively superior. It does everything I need it to with a simpler syntax. Let’s look at how it works. The Basic Fetch API Syntax For today’s article, we’ll use HOW TO PREVENT ANCHOR LINKS FROM SCROLLING BEHIND A STICKY Yesterday, we looked at how to create sticky headers with the position: sticky CSS property. One problem with sticky headers are anchor links. By default, they snap to the top of the document, behind the sticky navigation menu. You can see it yourself in this demo. Today, I want to talk about a CSS one-liner you can use to fix this. The scroll-margin-top property The scroll-margin-top property HOW TO ANIMATE SCROLLING TO ANCHOR LINKS WITH ONE LINE OF The scroll-behavior property tells the browser how to handle scrolling to anchor links within an element. The default value, auto, does a hard jump like you’re used to. A value of scroll tells the browser to animate scrolling. There’s no way to specify easing, but it ties into the browser’s refresh rate to give you silky smooth animations. HOW TO A FADE IN TO VANILLA JAVASCRIPT SHOW AND HIDE Last week, we created some simple show() and hide() methods, and added a transition animation to them. One of my readers mentioned that adding a fade in effect would be a nice visual touch, so today, let’s look at how to do that. It’s all CSS The good news is that this can be done entirely with CSS. First, we’ll add a default opacity of 0 to our .toggle-content class, and an opacity of 1 Skip to main content Accessibility Feedback Go Make Things* About
* Daily Tips
* Learn JS
🚀 _LAST CHANCE TO JOIN! A new session of the Vanilla JS Academy just started, but it's not too late to join. Register today and save 25%. Click here to join._
HI, I’M CHRIS FERDINANDI. I HELP PEOPLE LEARN VANILLA JAVASCRIPT. I believe there’s a simpler, more resilient way to make things for the web. I send out a short email each weekday with code snippets, tools, techniques, and interesting stuff from around the web. Join 12,200+daily subscribers.
If you're human, leave this blankEmail Address
Get Daily Developer Tips > This has easily been the most valuable newsletter I have ever > subscribed to. Thank you very much for sharing and educating!- Caleb> Stauffer
-------------------------* About
* Daily Tips
* Learn JS
* Search
Made with ❤️ in Massachusetts. Unless otherwise noted, all code is free to use under the MIT License . I also very irregularly share non-coding thoughts.
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0