I have a problem in javascript I make a window.open()
with a string the problem is that if the string has accents or cedillas gives error, someone knows a way to replace the accents or cedilhas by letter without accent or cedillas?
I have a problem in javascript I make a window.open()
with a string the problem is that if the string has accents or cedillas gives error, someone knows a way to replace the accents or cedilhas by letter without accent or cedillas?
You can use the encodeURI
function to URL-encode the characters.
var url = 'http://my.url.com/que/tem/ç/cedilha/e/ãé/acentos';
var encoded = encodeURI(url);
window.open(encoded);