What is the Difference between encodeURI and encodeURIComponent

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • This video explains the difference between the encodeURI method and the encodeURIComponent method and their practical applications.
    Also discussed are the decodeURI and the decodeURIComponent methods.
    Code GIST: gist.github.co...
    MDN reference for encodeURIComponent: developer.mozi...

Комментарии • 22

  • @jeanmarcpourchel307
    @jeanmarcpourchel307 3 года назад +2

    I missed this one when it was released!!!
    Very very useful!!!! Perfect explanation!!!
    Thank you very much.
    And as always thanks for teaching!!

  • @Venezuelangel
    @Venezuelangel 4 года назад +2

    Hi guy, in a world where Tech Tutorials have incomprehensible Hindi accents or native English speakers that sound like they're bored out of their minds explaining stuff, I ask you to please, please continue producing more content. Love your voice and your attitude. I don't know why your channel isn't bigger.
    Obviously I've just found your channel, and I'm sorry if you've already done a tutorial on it, but I would love a video on REAL form validation with Javascript and RegEx.
    Not the Fischer Price version for babies they teach you in IT courses, I mean the real ones where the RegEx expressions have like four lines of hieroglyphs. with RegEx that checks Emails, Passwords that require Uppercase and numbers, the whole Shebang.
    Stay awesome, mate.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      I have a couple intro videos on RegEx. Eventually I will make some more advanced ones. I will definitely be making more videos for a long time to come.

  • @barungh
    @barungh 4 года назад +2

    Very informative ... Learnt something new

  • @dmytromoroz4451
    @dmytromoroz4451 2 года назад +1

    Great video. Thanks a lot!

  • @iwswordpress
    @iwswordpress 4 года назад +1

    Very useful. Thanks.

  • @barungh
    @barungh 4 года назад +1

    Happy Christmas !👍🎄🎁

  • @abiakhil69
    @abiakhil69 4 года назад +2

    Happy Christmas ✌️

  • @arcadan
    @arcadan 2 года назад +1

    so bad.. I tot i could use encodeURL to dont encode "|" pipe, i need to send this like that, instead of encoded format, is there any way that could give me this solution?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад

      encodeURL means encoding a string so it is allowed to be passed as a valid value in an HTTP Request or Response. The values in the headers MUST be url encoded.
      You can decode the string on the other side - in the serverside code.
      If you are sending data via HTTP and don't want to use encodeURL then send it through the body.

  • @abiakhil69
    @abiakhil69 4 года назад +1

    Javascript patterns video upload it sir.

  • @OmgTruth
    @OmgTruth 4 года назад +1

    nice great video. wondering why angular router.navigate['=?/'] will convert to '%...'. Angular must be using encodeuricomponent by default. any inputs?

  • @theartist8835
    @theartist8835 3 года назад +1

    Thanks for sharing! what is a use case that we may need to use these methods ? I understand that they encode /decode the url, but why would we want to do so ?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад +2

      When you need to embed a Url inside a url. There are times when you need to pass a url from one page to another or to the server. This let's you hide the special characters and do so safely.

    • @theartist8835
      @theartist8835 3 года назад +1

      @@SteveGriffith-Prof3ssorSt3v3 much appreciated !

  • @jimshtepa5423
    @jimshtepa5423 Год назад +1

    what is the purpose of encoding? is it to hide path to the api from users?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      In a URL there are certain characters that have special meaning. Colons, ampersands, hashtags, equal signs etc. If you want to include one of those as part of your hash value or querystring then you need to URI encode the string. We need to hide the special characters but still include them.

    • @jimshtepa5423
      @jimshtepa5423 Год назад +1

      @@SteveGriffith-Prof3ssorSt3v3 understood! thank you

  • @whenlifegivesyouLSD
    @whenlifegivesyouLSD 4 года назад +1

    Too many browsers bruh !!!