Sisira 95

Example: The following code is before the body of the page. The & sign in the Query String causing the invlaid reference. What should i do to get rid of this ?

<script type="text/javascript">
    var btJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
    document.write(unescape("%3Cscript src='" + btJsHost + "' type='text/javascript'%3E%3C/script%3E"));


2 answers

danwellman 5600

You could URL encode the ampersand

Answered over 8 years ago by danwellman

You could also use the HTML entity - &amp; - in the URL.

Answered over 8 years ago by Laurie M. Rauch