How LocalStorage and Event Delegation work.

  Рет қаралды 31,620

Wes Bos

Wes Bos

Күн бұрын

Пікірлер: 55
@julianstorm7722
@julianstorm7722 4 жыл бұрын
Why did I not do this series when I started with js....came here to review some concepts and found out there's fair a few things I haven't covered...Thanks for this great series....You deserve way more subs.
@WesBos
@WesBos 4 жыл бұрын
Thank you!
@frankiev1785
@frankiev1785 6 жыл бұрын
One of my favorite videos on LocalStorage so far. Thanks Wes!
@hibritusta2642
@hibritusta2642 4 жыл бұрын
Greetings from Turkey. You have a very good expression. The subject is well understood with real life applications! Congratulations and thanks!
@alexandera6012
@alexandera6012 3 жыл бұрын
Thanks a lot, Wes! This video and the whole JS30 series are super useful and fun. Learned a lot from just watching your step-by-step building process.
@1lucas132
@1lucas132 4 жыл бұрын
Several very important concepts applied in practice ... Thanks Wes
@gothamfury
@gothamfury 4 жыл бұрын
Thank you for this video! I'm just getting into JavaScript and learning about LocalStorage and this has been very helpful. I like the editor you're using too. The cursive script for properties is cool.
@Ludo045
@Ludo045 2 жыл бұрын
this is helpful as a beginner ? it's a bit complicated i think... This is a changelle and i could have never ever be able to do this alone.
@ArifBasri
@ArifBasri 4 жыл бұрын
timeless tutorial! thanks very much Wes!
@lukasluftlaufer1093
@lukasluftlaufer1093 4 жыл бұрын
This is so clever! Learned a lot! Thanks Wes.
@avi12
@avi12 6 жыл бұрын
12:10 Or, just wrap the input and the text in and you don't need to do that you did. I.e. ${place.text}
@nathancornwell1455
@nathancornwell1455 4 жыл бұрын
still best practice to link them together .....
@polmeep9484
@polmeep9484 2 жыл бұрын
Hi, how did you configure autocomplete of html tags in backticks? I'm using a VS Code but for me it's not working.
@shimphillip
@shimphillip 6 жыл бұрын
Priceless Tutorial. Thanks!
@akramadil7502
@akramadil7502 5 жыл бұрын
I don't clearly understand why you called"populateList" again in the end at line 60. 19:17
@julianstorm7722
@julianstorm7722 4 жыл бұрын
Without calling it again the saved keys in localstorage would only show up on submit and not on every page load.
@wentingsong9435
@wentingsong9435 4 жыл бұрын
How do you type the taco or the poop icon there?
@giadungtienichnoha9288
@giadungtienichnoha9288 4 жыл бұрын
My solution for the challenge (It can toggle between check all & clear all). // Create a button with class check-all in HTML and select it const checkAll = document.querySelector('.check-all'); // Add click event checkAll.addEventListener('click', handleCheckAll); // Function handle event function handleCheckAll(e) { const allCheck = items.every((item) => item.done === true); if (allCheck) { items.forEach((item) => (item.done = false)); } else { items.forEach((item) => (item.done = true)); } localStorage.setItem('items', JSON.stringify(items)); populateList(items, itemsList); }
@erikhendin3459
@erikhendin3459 Жыл бұрын
Thank you for sharing this! I was struggling with this, I got select all working in separate examples but not in this code context with local storage. Nice work, you helped me out.
@trophydevice7624
@trophydevice7624 3 жыл бұрын
Has anyone tried adding a delete button? I am struggling on that one..
@Bajdster
@Bajdster 2 жыл бұрын
I have a problem, 13:53 when I try to check checkbox it isn't working, checkbox doesn't responding, there is no error on console.Help
@anokhps3088
@anokhps3088 2 жыл бұрын
same problem,have you solved it out?
@ahherewhatsthestory
@ahherewhatsthestory 5 жыл бұрын
Does anyone know how I can add a button to each item to delete it from the list? Any help is much appreciated.
@丶-s3u
@丶-s3u 3 жыл бұрын
while input has display : none how can he detected if is checked or not ? didn't work for me so I add this code position: absolute; opacity: 0; cursor: pointer; I just wanna know how it's work for him 🤔
@fespamo
@fespamo 2 жыл бұрын
i'm still a beginner , i realise this as i need to watch an practice this video 2 or 3 times
@mirage4731
@mirage4731 3 жыл бұрын
I didn't understood the need of ${plates.done ? 'checked' : ''} Why we use it ??
@WesBos
@WesBos 3 жыл бұрын
If the plate has a property of done, it returns a string of “checked” which causes the HTML of the input to make it checked. Otherwise we return an empty string, which is not checked
@mirage4731
@mirage4731 3 жыл бұрын
@@WesBos thanks a lot 😁, this playlist is amazing, i loved it
@MarcelRobitaille
@MarcelRobitaille 7 жыл бұрын
You don't need to re-render the html when you check/uncheck because you don't call preventDefault. It also might be a good idea to use el.checked rather than !items[index].done just in the off chance that this got messed up somehow.
@kissu_io
@kissu_io 7 жыл бұрын
You need something like 'itemsList.children[0].children[0].checked' to use the checked method ? Didn't achieved to make it that way but if it's indeed using the DOM, it's pretty meh.
@AhmedSamir-hx3ip
@AhmedSamir-hx3ip 5 жыл бұрын
@ 10:25 , when i try & type something & submit it, the Loading Tapas... disapear & nothing added, then when i try to add something one more time it adds what i typed pervious, my code is just like yours thanks
@AbsarNaeem1
@AbsarNaeem1 5 жыл бұрын
You have to place your populateList() function after the items.push() function.
@ClevertonHeusner
@ClevertonHeusner 4 жыл бұрын
Excelent job.
@peterchen1774
@peterchen1774 7 жыл бұрын
Really a nice video tutorial! Thanks~
@talhaabbas1816
@talhaabbas1816 3 жыл бұрын
what an amazing way to teach event delegation 😂😂😂
@dentistasenciudadjuarezchi1154
@dentistasenciudadjuarezchi1154 6 жыл бұрын
done lol, i finally got a delete button to work on the list, but the only problem is that it deletes everything, instead of a single item. So i named that button delete all lmao
@burhaanhassan5498
@burhaanhassan5498 11 ай бұрын
use reduce Function and set the index !=plate.i.
@francissicnarf4707
@francissicnarf4707 7 жыл бұрын
i got same result without calling populateList when clicking checkbox 29:05
@avi12
@avi12 6 жыл бұрын
In localStorage, instead of localStorage.setItem("name", "value") - you could just: localStorage.item = "value" Also, note that there's a limit to how many strings can be stored in MBs, according to developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria
@amitpurohit8816
@amitpurohit8816 4 жыл бұрын
Which editor is this??
@TheRuky
@TheRuky 7 жыл бұрын
AWESOME! Can you please tell me which text editor or IDE are you using? Thanks.
@julianklumpers
@julianklumpers 7 жыл бұрын
Renato Ruškan SublimeText with the cobalt2 theme and the font is Operator Mono
@okoiful
@okoiful 6 жыл бұрын
its actually vs code i think....
@yordangalabov2113
@yordangalabov2113 6 жыл бұрын
Wes is using Sublime. He even has a book on it. More info here: wesbos.com/?s=sublime
@michaeldpadilla
@michaeldpadilla 6 жыл бұрын
Wes is using VSCode with a converted Cobalt theme. That link you gave us is almost 3 years old already which is eons in the world of development. He explains this in his Syntax podcast which you all should be listening to if you haven't already! Yes, I know this video is from September 2017... He still was using VSCode then.
@yordangalabov2113
@yordangalabov2113 6 жыл бұрын
Michael Padilla Agreed. Thanks for your reply.
@mdsagorahmed2546
@mdsagorahmed2546 4 жыл бұрын
How Can I get source file?
@WesBos
@WesBos 4 жыл бұрын
JavaSCript30.com
@Mustafaismail22
@Mustafaismail22 7 жыл бұрын
Great video, Thank you 😘
@bendude
@bendude 4 жыл бұрын
getting this error when i open the index-START.html file: 'Failed to load resource: the server responded with a status of 404 ()' anybody know how to fix this?
@chiragmehta84
@chiragmehta84 4 жыл бұрын
The error is caused because the background url in style.css is set to wes.io/hx9M/oh-la-la.jpg which no longer exists. Replace it with this and it'll work fine background: url('source.unsplash.com/N_Y88TWmGwA/640x426')
@kissu_io
@kissu_io 7 жыл бұрын
As you're a daddy, I liked the way you explained the event delegation. :P
@mikolwski
@mikolwski 6 жыл бұрын
Instead of 'click' I listen to the 'change' and i think it works fine too
@NitinGoyal-tf8tz
@NitinGoyal-tf8tz Жыл бұрын
I have a better method in O(n) time complexity function addItem(){ e.preventDefault(); const text=(this.querySelector('[name=item]')).value; const newLi=document.createElement('li'); newLi.innerHTML=text; itemsList.appendChild(newLi); this.reset(); }
Vanilla JS Countdown Timer - #JavaScript30 29/30
21:46
Wes Bos
Рет қаралды 25 М.
JavaScript Cookies vs Local Storage vs Session Storage
14:28
Web Dev Simplified
Рет қаралды 773 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
A Deep Dive into JVM Start-Up
22:03
Java
Рет қаралды 29 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 1,3 МЛН
14 Must Know Chrome Dev Tools Tricks - #JavaScript30 9/30
10:36
JavaScript Text-To-Speech - #JavaScript30 23/30
16:56
Wes Bos
Рет қаралды 28 М.
Vanilla JavaScript Slide In on Scroll - #JavaScript30 13/30
12:58
Ajax Type Ahead with fetch() - #JavaScript30 6/30
17:22
Wes Bos
Рет қаралды 59 М.
Local Storage Explained In 10 min | Javascript
10:53
Redhouane Aouadi
Рет қаралды 69 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН