Due to some Javascript actions to vars I got &
instead of &
in my var:
So I tried this:
url_summer = 'http://192.168.0.20/menulb.php?w=chapter&if=If_menulb&p=' + page ;
url_summer = url_summer.replace(/&/g, '&');
alert(url_summer) ;
And the alert gives me:
http://192.168.0.20/menulb.php?w=chapter&if=If_menulb&p=521
This is strange, the function replace doesn't want to change &
to &
.
If I do the same to change &
to +
it works!
url_summer = url_summer.replace(/&/g, '+');
How cant I change &
to &
?
Decode it like this:
var str = "http://192.168.0.20/menulb.php?w=chapter&if=If_menulb&p=521";
var div = document.createElement('div');
div.innerHTML = str
var decoded = div.firstChild.nodeValue;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With