URL encoding
Në shqip: Kodimi i URL-ve
ShpjegimiSQ
URL-të s'mund të kenë hapësira ose shkronja si ë direkt — kodohen me %: hapësira bëhet %20, ë bëhet %C3%AB. Në JavaScript përdor encodeURIComponent() kur fut tekst të përdoruesit në URL.
EnglishEN
URLs can't contain spaces or letters like ë directly — they're encoded with %: a space becomes %20, ë becomes %C3%AB. In JavaScript use encodeURIComponent() when putting user text into a URL.
Si ta mendosh
Si t'i shkruash shkronjat e veçanta me kode që i kupton çdo postier.
Lexoje në anglisht
Like writing special letters in codes every postman understands.
Shembull kodijavascript
const q = encodeURIComponent("çfarë është API?");
fetch(`/kerko?q=${q}`);