JavaScript Search Bar

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 203

  • @novaria
    @novaria 3 роки тому +44

    omg thank you so much! This was exactly what I was looking for. No need for bloated frameworks, overly-complicated dependencies with npm etc. And the code is super beautiful too.

    • @lookupverazhou8599
      @lookupverazhou8599 2 роки тому

      Everything can be done with vanilla, and more robustly, too.

  • @krisashehi5144
    @krisashehi5144 2 роки тому +15

    One of the best tutorials I’ve ever come across. Super easy to understand, and the code looks super tidy.

  • @TrashyyChan
    @TrashyyChan 2 роки тому

    you just saved me from failing a class!! This was legit my whole semester work and i struggled so hard with the fecthing of the data from a json file (not even the searchbar but that helped too!)
    Thanks man for not just showing the searchbar but also the full process!!

  • @Aditya_Kumar_12_pass
    @Aditya_Kumar_12_pass Рік тому +1

    awesome. I was struggling to do this thing in react / next, took some time and worked !!

  • @rishiprasath
    @rishiprasath 2 роки тому +1

    Great! Now I can create an offline search with filtering. Good enough for working on a project without a database!

  • @amberw0704
    @amberw0704 2 роки тому +1

    Bless up! 🙏 been struggling with a search function for two weeks and this just made it so simple and you were great at explaining it - not just running through everything super fast and confusing!

  • @derickmoncado
    @derickmoncado Рік тому +1

    I like this one more then Kyle's from WebDevSimplifeid, no offense to Kyle though! You're both legends, thank you both!

    • @JamesQQuick
      @JamesQQuick  Рік тому +1

      bahaha I'll make sure to let him know!

  • @iwatchtoomuchhaikyuu5307
    @iwatchtoomuchhaikyuu5307 2 роки тому +2

    easily one of the best tutorial videos Ive seen, everything simplified and explained clearly and well. !!! just subscribed

  • @mateinegrescu8573
    @mateinegrescu8573 3 роки тому +3

    Thank you, this was very instructive! I am also wondering how I could use checkbox filters on top of the search filter. For instance limit the search to just members of the Slytherin house by having and checking a Slytherin checkbox.

  • @storyPlus12
    @storyPlus12 2 роки тому

    Thank you so much brother 🙏

  • @zaurhasanov5458
    @zaurhasanov5458 Рік тому

    Thank you! I was really struggling with this functionality and other tutorials didn't really help

  • @abdessadekelaasri8862
    @abdessadekelaasri8862 2 роки тому

    You're the best teacher in UA-cam, thanks so much

  • @musadanjuma6603
    @musadanjuma6603 4 роки тому +3

    Great Tutorial James!!! looking forward to implementing this to the next app I'm developing... Thank you soooo much :)))

  • @Jun-zq3bn
    @Jun-zq3bn 3 роки тому +1

    works wonders, and had much fun plugging this into my backend database. thanks alot!

  • @georgelopez9356
    @georgelopez9356 4 роки тому +2

    Great video, very clean and easy to undestand code. Great Job!!!

  • @smjonas8616
    @smjonas8616 2 роки тому

    Thank you so much for this video! I am glad to hear that I don't need to learn a new Javascript framework for a simple search UI... It's sad that this basic stuff is so hard to find.

  • @Domuh
    @Domuh 3 роки тому +1

    Hello, I was wondering if it is possible to also search by Number? I am doing the Pokedex you did and am implementing this Search Bar, however I can't seem to search for the IDs and Names because of the .Lowercase()

    • @JamesQQuick
      @JamesQQuick  3 роки тому +1

      You could certainly query by number if you want. Maybe you could have two different inputs, one being a number?

    • @Domuh
      @Domuh 3 роки тому +1

      @@JamesQQuick Thanks. Rather than doing pokeman.id.includes(), I did pokeman.id == searchTarget

  • @freestyleerimasbr2851
    @freestyleerimasbr2851 4 роки тому +2

    Thank you very much James! I am having a workshop at my school, and I was wondering if you could help on how to change the json file of harry potter characters to another json file and make the searching work, I am trying but without success!! Great video by the way!

    • @sarachachilina
      @sarachachilina 3 роки тому

      @@i-am-oi how did you change the Json file?

  • @codedynamics1
    @codedynamics1 4 роки тому

    i had to just grab the input value using querySelector and it worked. Great video!! Simple to understand. Thank you!

  • @jesusdmmful
    @jesusdmmful 3 роки тому +1

    James, i have a question, how can i do that search bar but using rick and morty api? i´m trying to do, but i have an error: array.filter is not a function :C . you are amazing!!. nice video

  • @rebequini
    @rebequini 2 роки тому

    This is exactly what i needed for my project for this week hahha! seriously thank you so much !!!!!!! :)

  • @packagedstudios
    @packagedstudios 3 роки тому +1

    Thanks so much for explaining it so clearly :D

  • @doesitstill
    @doesitstill 3 роки тому

    Cheers, leveraged this tutorial to make a simple app using WordPress and the rest API

  • @mattmjlg5053
    @mattmjlg5053 2 роки тому

    Dude I cannot believe you would do something like this this is unbelievable I’m so proud of that guys like you are so smart and can figure out that this would help us out so much I am trying to start my own start up company but I can help with searching things up for my program and I’m very new so it’s not easy thank you so

  • @Robert723
    @Robert723 3 роки тому +1

    Great tutorial!

  • @om7334
    @om7334 2 роки тому

    Wonderful tutorial, subscribed!

  • @denisradovanovic8778
    @denisradovanovic8778 Рік тому

    Hi James, would you mind sharing how can we use multiple words in a search to filter out, say for example: Diggory Snape? Thanks for great video.

  • @daniaburiachenko7713
    @daniaburiachenko7713 2 роки тому

    wow! thx u so much :) the best tutorial video on UA-cam Ive seen!!!

  • @az1nn
    @az1nn 3 роки тому

    Thanks for this video man! Greetings from Brazil!

  • @gonzalobarg3460
    @gonzalobarg3460 3 роки тому

    Great tutorial, very well explained!

  • @markreeves5561
    @markreeves5561 4 роки тому +1

    Thanks very much for this tutorial. I have learned a lot from this tutorial. Thanks

    • @JamesQQuick
      @JamesQQuick  4 роки тому

      Glad to hear it!

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @ajaydev7866
    @ajaydev7866 3 роки тому

    thx for your video ! question : i have 2 search bar 1 for desktop view and another for tab view how to impliment in both
    ?

  • @anthonysetiadi
    @anthonysetiadi 3 роки тому

    This was great! Quick question, how would add functionality if you inserted a 'space' in your search query? Ie. search full name: Harry Potter

  • @swatilekha_roy
    @swatilekha_roy 3 роки тому

    Sorry if it's a lame question, but how to set up the api? Actually it's for my project, where I am trying to set up a search bar functionality where the search will filter results according to the "tags" present on each card. Each card may have multiple tags. Many thanks for the tutorial! Much appreciated.

    • @raygud5653
      @raygud5653 3 роки тому

      Did you ever figure it out if not i can let you know

    • @swatilekha_roy
      @swatilekha_roy 3 роки тому

      Hey thank you so much for replying!!
      I did figure it out in the end, I simply added the tags as multiple class names to the cards and then filtered the results with js.

  • @charlest3788
    @charlest3788 4 роки тому

    I like your sense of humour. Nice tutorial man!

  • @tonyy.9855
    @tonyy.9855 2 роки тому

    this tutorial is so good.

  • @jenshattas
    @jenshattas 2 роки тому

    how can you make sure that for example if there where 2 harry potters but you needed only 1 it doesn't show doubles?

  • @cafeleche
    @cafeleche 2 роки тому

    Really enjoyed it!!

  • @Dare_to_face_Ted
    @Dare_to_face_Ted 2 роки тому

    hey james thank you for the tutorial i'm just want to ask you i want to change the names and when it clicked on one of them it will take to another page can you help me pls ??

  • @DeniTosh
    @DeniTosh 3 роки тому

    How would you access it if it was wrapped in an object? For example { - char:[the api]}.

  • @unknownuser8276
    @unknownuser8276 2 роки тому

    Hi, May I know how to change the harry potter characters into other characters from other movies? Like changing the harry potter characters into avengers characters

  • @zachfenton608
    @zachfenton608 2 роки тому

    loved it a lot, would like to know how it can search through html or pictures that I have in an array or by event that i have i as cards

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @kamertonaudiophileplayer847
    @kamertonaudiophileplayer847 2 роки тому

    Interesting, it looks like you are a little old school comparing to the " Web Dev Simplified", but anyway, it is a great guide.

  • @MichielvanderGragt
    @MichielvanderGragt 2 роки тому

    Hi James, great tutorial. I am fairly new to JS and have a quick question about how you use the map method() to fill the string literals. Can I generate the outcome of another function inside a string literal? For example a list I generated somewhere else? Thanks! Michiel from Sweden

  • @pushpraj853
    @pushpraj853 Рік тому

    why am I getting empty array when trying to console.log(hpCharacters) outside the async function

    • @JamesQQuick
      @JamesQQuick  Рік тому

      Hard to tell without code. I have a Discord where you can ask questions and share code. learnbuildteach.com/

  • @thienay3899
    @thienay3899 3 роки тому

    tks alot for this helpful tutorial.

  • @tomcoop9750
    @tomcoop9750 2 роки тому

    Awesome video 👍

  • @jefflo3113
    @jefflo3113 3 роки тому +1

    Hi James, Nice video. Im wondering if it is possible to list the characters in alphabetical order? If so how would you do it?

    • @jacksonsingh1380
      @jacksonsingh1380 3 роки тому

      if your trying to sort the names in alphabetical order and the element for the name is formatted in full, this is what you want:
      data.sort((a, b) => {
      let splitNameA = a.name.split(" ");
      let splitNameB = b.name.split(" ");
      let lastNameA = splitNameA[splitNameA.length - 1];
      let lastNameB = splitNameB[splitNameB.length - 1];
      if(lastNameA < lastNameB){
      return -1;
      }else if(lastNameA > lastNameB){
      return 1;
      }else{
      return 0;
      }
      });

  • @muhammadwadeed8967
    @muhammadwadeed8967 4 роки тому +2

    I want to know that how to create data in this link on herokuapp. hp-api.herokuapp.com/api/characters

  • @keeprunning5457
    @keeprunning5457 Рік тому

    nice man gracias otra vez!

  • @roycrave2420
    @roycrave2420 3 роки тому

    harry potter functions in javascript! love it!

  • @ElSpoon
    @ElSpoon 2 роки тому

    Is there a way to have the unfiltered list hidden, then shown once it starts filtering? That’s what I’m looking for but can’t find a solution anywhere

  • @sinnyozzy
    @sinnyozzy 2 роки тому

    Thank you!

  • @rosacabrera4733
    @rosacabrera4733 3 роки тому

    This was amazing! It worked like a charm. Thank you so much!!!

    • @Dare_to_face_Ted
      @Dare_to_face_Ted 2 роки тому

      can i ask you pls i want to change the names so how i can do that ?

  • @nemethricsi
    @nemethricsi 2 роки тому

    What font are you using, Master? 😍

  • @AP-gc5ss
    @AP-gc5ss 3 роки тому

    Thanks for teaching!

  • @Goldn_valouz
    @Goldn_valouz 3 роки тому

    Thanks a lot I hope i'll get my internship with this searchBar. I've learned a lot

  • @Shujaathullakhan
    @Shujaathullakhan 2 роки тому

    how do i dynamically refresh my html with the final filtered array, iam dsplaying my index from database pls help

  • @protopan7722
    @protopan7722 Рік тому

    thank you so much this video is very good

  • @Blue-db5kk
    @Blue-db5kk 4 роки тому

    Great tutorial pal! I have a question though. When I replicated this whenever I type a string that is NOT contained in ANY of the object´s keys, the page shows the last matches of the search (HP Characters in your example) instead of no matches at all. Any idea how to fix this?
    Thank you for the great video

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 8 місяців тому

    Thank you very much

  • @valeriacerpasalas2330
    @valeriacerpasalas2330 2 роки тому

    Amazing code ♥ I love it, I would like to edit the json, do you know if it is possible? I see there are some characters that do not have a photo. I would like to add one. Could it be possible? Thanks

  • @LucasGenolet
    @LucasGenolet 3 роки тому

    Excellent, thanks a lot!!

  • @EDW4RD249
    @EDW4RD249 3 роки тому

    Sr. Thank you!

  • @raba650
    @raba650 3 роки тому

    How can I search with a button onclick instead of the onchange from the input?

  • @adnanrruka5152
    @adnanrruka5152 3 роки тому

    Thank you

  • @84PatSch
    @84PatSch 3 роки тому

    thank you very much, it was very helpful

  • @settahkader
    @settahkader 4 роки тому

    thanks for the tutorial, its very helpful

  • @ugochukwuanajemba3117
    @ugochukwuanajemba3117 3 роки тому

    I love this video. Please could u design a page like this with pagination. I was thinking one could use this in a more fashion way to replace small responsive tables, e.g. user management system.

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @user-hh2is9kg9j
    @user-hh2is9kg9j 4 роки тому

    Thanks James! Any idea how to display the number of found results?

    • @georgelopez9356
      @georgelopez9356 4 роки тому

      innerHTML of = array.length ...

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @ahmad_mido
    @ahmad_mido Рік тому +1

    it says "failed to fetch".. how to solve it please?

  • @flavienmayet-webdev7392
    @flavienmayet-webdev7392 Рік тому

    Character.map() doesn't work for me. It display map() is not function. How resolve problem ?

  • @funchakkar6477
    @funchakkar6477 3 роки тому

    Sir, nice video. I'm beginner can you tell me please what's code or how to write api characters. I don't know which Language you use. Html, css, or javascript. How to write like you api characters

  • @vujadinovicc
    @vujadinovicc 2 роки тому

    hello bro, can this javascript be used for any website or only for this one,

  • @hoanchaukhai7942
    @hoanchaukhai7942 2 роки тому

    thanks you so much!!! this very useful to me hope u release more video like this

  • @TheRuttekut
    @TheRuttekut 3 роки тому

    Great video thanks!

  • @InvictusGamingOfficial
    @InvictusGamingOfficial 2 роки тому

    I Need A Help!!!
    Please Tell Me How To Make Our Own API of Our Database Like Harry Potter API...

  • @CoderDmitri
    @CoderDmitri 3 роки тому

    ty so much. You are a Star!

  • @チョリパン-j4f
    @チョリパン-j4f 4 роки тому

    Thanks you so much for this video!

  • @ktkkoko4331
    @ktkkoko4331 3 роки тому

    Very good sir I like it

  • @jordanholder5373
    @jordanholder5373 3 роки тому

    saved my fucking life thanks

  • @funnyanimalworld7579
    @funnyanimalworld7579 2 роки тому

    wouldnt it would be more logical if search checked from first letter moving forward and not if letter exist anywhere in the name?

  • @alanawinarta9887
    @alanawinarta9887 3 роки тому

    Thanks a lot!

  • @Ronifromearth
    @Ronifromearth 2 роки тому

    THANKYOU

  • @anythingfx8950
    @anythingfx8950 3 роки тому

    Any idea how could i implement BACKSPACE? if i type too many letters and press backspace to erase wrong ones it shows that? because it is missing feature for me :) other than that very nice tutorial :)

  • @alcantaraallan
    @alcantaraallan 4 роки тому

    hi, thank you for this wonderful tutorial, I will try this. Question, how do you make the character clickable to its single page with their info? thank you

    • @georgelopez9356
      @georgelopez9356 4 роки тому

      probably I'll get all elements by class name and addEventListenert to that array.

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 роки тому

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html

  • @WanKy182
    @WanKy182 4 роки тому

    Thanks for tutorial.

  • @sabuein
    @sabuein 3 роки тому

    Thank you ☺️

  • @Peywan
    @Peywan 2 роки тому

    but how do I make these work on a page I have done?

  • @Pedrove545
    @Pedrove545 4 роки тому

    Really helpful thx

  • @nolose6542
    @nolose6542 3 роки тому

    thanks you so much !!!!

  • @ruchirshrikhande5584
    @ruchirshrikhande5584 Рік тому

    Hey,does anyone know how to fetch data from mongodb in client side instead of using a url in fetch?

  • @kyleparsotan6799
    @kyleparsotan6799 4 роки тому

    how to build a json database and create the URL and connect it to the fetch data?

    • @JamesQQuick
      @JamesQQuick  4 роки тому

      Look up creative a node server

  • @enderbasser
    @enderbasser 2 роки тому

    this was great tutorial, i wonder if you colud help me, i got it to work but i would like it to let me look whit 2 words. i mean, what if instead of looking for "HARRY", i want to look for "HARRY POTTER" to give you some context: what if i wanted to look in an ecommerce for "white fridge"
    i ask this because even when i got it to work whenever i put the "space" or (" ") it doesnt return any object. i am not an english native speaking so i hope you understand thanks

  • @banseveral8966
    @banseveral8966 3 роки тому

    Very nice !

  • @untildawn5714
    @untildawn5714 3 роки тому

    The man! Thanks!

  • @minhazhalim2097
    @minhazhalim2097 6 місяців тому

    Does not working. it shows error - 'hpCharacters.filter is not a function'

  • @chrisdizzle313
    @chrisdizzle313 4 роки тому

    I thought this was dope man. I'm going to build this using the same API cuz in also an HP nerd.

  • @adimorachidozie9350
    @adimorachidozie9350 3 роки тому

    hello James, please is there a way to keep the characters from showing and only appear when you search for it , please help
    thanks

    • @lavishkumar9075
      @lavishkumar9075 3 роки тому

      you could set the ul style to display none and check every time user presses a key see if the input text value is bigger or equal to 1 make the ul display block and else have ul display none.

  • @ankitsharma6408
    @ankitsharma6408 3 роки тому

    thank you so much..,