Hey, who keeps chaning my escaped character!

Giganews Newsgroups
Subject: Hey, who keeps chaning my escaped character!
Posted by:  Rob Morrison (rober…@san.rr.com)
Date: Sun, 22 Aug 2004

The sample below demonstates an issue that I cannot seem to workaround.  I
have an Url with a value that contains an ampersand.  I have escaped the Url
using both the hex value and it works fine when used in a href.  But, if I
pass the same Url to the open() function it unescapes my ampersand while
leaving the other escaped untouched.  This behavior is the same for both IE
and Mozilla Firefox, I guess this is known behvoir unknown to me.

Does anybody know how to pass an ampersand in a name value pair to the open


<%@ Language=javascript %>
<script language="javascript">
        function showEscapeVar() {
                return false;
<body onload="showEscapeVar()">

        <a href="whoatemyescape.asp?escapevar=Sanford%20%26%20Son">Href

opup Escape</a>