Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,880 questions

51,806 answers

573 users

How to encode URL in JavaScript

2 Answers

0 votes
URL = "https://www.seek4info.com/search.php?query=web+hosting+";

let encodedURL = encodeURIComponent(URL);

console.log(encodedURL);


  
    
    
/*
run:

"https%3A%2F%2Fwww.seek4info.com%2Fsearch.php%3Fquery%3Dweb%2Bhosting%2B"
    
*/

 



answered Jan 29, 2021 by avibootz
0 votes
URL = "https://www.seek4info.com/search.php?query=web hosting &order=rand";

let encodedURL = encodeURI(URL);

console.log(encodedURL);


  
    
    
/*
run:

"https://www.seek4info.com/search.php?query=web%20hosting%20&order=rand"
    
*/

 



answered Jan 29, 2021 by avibootz

Related questions

3 answers 233 views
2 answers 152 views
2 answers 207 views
2 answers 229 views
229 views asked Jul 22, 2016 by avibootz
2 answers 231 views
1 answer 159 views
1 answer 219 views
...