var string = encodeURIComponent('&'); // "%26" window.location = 'http://example.com/?string='+string; //example.com/?string=%26