0

Hello I have some variables in Javascript that can have values as “Creación de” I need to convert to send to an html page as “Creaci%F3n%20de”. How can I make that conversion in Javascript?

Thank you

coerrace
  • 159
  • 1
  • 6

1 Answers1

1

You can use the function encodeURI() to accomplish that.

maurogandulfo
  • 430
  • 3
  • 8
  • I see encodeURI() works but the problem I see is that firefox in the line of browser it doesn’t process like that it sends without encode and the special characters cause a mess. We have a variable that needs to launch a page but we need that page be sent to firefox like that. Google chrome works perfectly but firefox by any reason when you launch the page with window.open it sends to firefox without the encodeuri. How can I do so firefox send encoded? – coerrace Feb 25 '21 at 17:33
  • Without seeing the code I cant say you if there is anything wrong. Can you provide the actual code?? – maurogandulfo Feb 25 '21 at 17:36
  • This is the code https://pastebin.com/U4ehc0Vb – coerrace Feb 25 '21 at 18:22
  • 1
    I solved the case but I used escape and the variable and done. – coerrace Feb 25 '21 at 19:25