Iam forming a URL in JavaScript and passing this URL on click of a custom button,i want to encode the parameters, some of the parameters having value like &, I tried with string.replace() and encodeURI..
var url = '/apex/GSDCSCAccountLocationSearch?srmid=' + '{!pse__Proj__c.Id}'+
'&cmpname=' +'{!pse__Proj__c.pse__Account__r.name}' +
'&city=' +'{! pse__Proj__c.PSA_Location_City__c}' +
'&state=' +'{! pse__Proj__c.PSA_Location_State__c}' +
'&zip=' +'{!pse__Proj__c.PSA_Location_Zip__c}'+
'&renderSaveButton=TRUE'+'&country='+CountryCode;