vi****@free.fr (vigi98) writes:
Thanks for this very helpfull solution. Nevertheless, what is the
solution ? I also tried this:
strURLpiece.replace(/&/,"%26");
but it does not work better.
You wanted the value of strURLpiece to change. For that you need an
assignment. The replace method does not change the string. So, at least;
strURLpiece = strURLpiece.replace(/&/,"%26");
The next problem is the "&". If the script is embedded in HTML, the
ampersand has a special meaning, and should be (HTML-)escaped:
strURLpiece = strURLpiece.replace(/&/,"%26");
If the script is not embedded in Javascript, then you should not escape
the ampersand. If you want to avoid thinking about it, you can use a
Javascript escape:
strURLpiece = strURLpiece.replace(/\x26/,"%26");
Good luck.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'