[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - The Event Loop in PracticeAug 18, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Coding Challenge #1Aug 17, 2022
[JavaScript] DOM - Find a DOM NodeHow would you implement getElementsByAttribute? HTML <!DOCTYPE html> <html> <head> <title>The DOM is cool</title> <script type="text/javascript" src="activity.js"></script> </head> <body> <h1 class="header">The DOM is cool for man...Aug 18, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Throwing Error ManuallyAug 16, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Handling Rejected PromisesAug 15, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Chaining Promisesconst getCountryData = function (country) { // country 1 fetch(`https://restcountries.com/v2/name/${country}`) .then(response => response.json()) .then(data => { renderCountry(data[0]); const neighbor = data[0].borders[0]; ...Aug 15, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Consuming Promises// const request = fetch(`https://restcountries.com/v2/name/portugal`); // console.log(request); // const getCountryData = function (country) { // fetch(`https://restcountries.com/v2/name/${country}`) // .then(function (response) { // co...Aug 12, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Promises and the Fetch APIs// Promises const request = fetch(`https://restcountries.com/v2/name/usa`); console.log(request);Aug 12, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Callback Hellconst renderCountry = function (data, className = '') { const html = ` <article class="country ${className}"> <img class="country__img" src="${data.flag}" /> <div class="country__data"> <h3 class="country__name">${data.name}</h3> ...Aug 12, 2022
[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - AJAX call: XMLHttpRequestconst btn = document.querySelector('.btn-country'); const countriesContainer = document.querySelector('.countries'); /////////////////////////////////////// const getCountryData = function (country) { const request = new XMLHttpRequest(); reque...Aug 12, 2022
[JavaScript] Mapty App: OOP, Geolocation, External Libraries, and More! - Working with localStorageSet and get localStorage _setLocalStorage() { localStorage.setItem('workouts', JSON.stringify(this.#workouts)); // for only small amount of data. For big data, this is not a good way... } _getLocalStorage() { const data = JSON.parse(loc...Aug 3, 2022