...

View Full Version : problem in getting rid of '+' sign in url encoding



vopatel
05-21-2005, 05:52 PM
Hi,

I am facing problem getting rid of '+' sign in url.

My code is**************************************

<script language="javascript">
function popBanner(path, width, height, scroll) {
var re = /\+/g;
var oat = new String(path.replace(re,"%2b"));
alert(oat);
var attributes = "left=190,top=310,width=" + width + ",height=" + height + ",scrollbars=" + scroll;
var myPop = window.open(oat,'popBanner',attributes);
myPop.focus();

} // End of pop.
</script>

<a href="javascriptopBanner('www.mydomain.com?ab=er+s','700','500','yes')">
<img src="http://www.ourdomain.com/referral_150x150.gif" /> </a>



**********************************************************
When I click on the image, I don't see '+' sign in alert message of javascript, but the '+' sign passes instead of '%2b' in the url for the popup window. I also tried window.open(encodeURI(oat),'popBanner',attributes), but still it passes '+' sign, instead of '%2b' in the URL of popup window. I am using IE 6.0, also tried with firefox 1.2

Can anybody help me?

Thanks,
Vishal

shnplr
05-22-2005, 04:51 AM
Where exactly are you 'seeing' the '+' sign instead of %2B ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum