Answers for "convert path string to url encoding javascript"

0

convert path string to url encoding javascript

var myOtherUrl = 
       "http://example.com/index.html?url=" + encodeURIComponent(myUrl);
Posted by: Guest on September-15-2021
0

convert path string to url encoding javascript

const uri = 'https://mozilla.org/?x=шеллы';
const encoded = encodeURI(uri);
console.log(encoded);
// expected output: "https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"

try {
  console.log(decodeURI(encoded));
  // expected output: "https://mozilla.org/?x=шеллы"
} catch (e) { // catches a malformed URI
  console.error(e);
}
Posted by: Guest on September-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language