Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem in getting rid of '+' sign in url encoding

    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

  • #2
    New Coder
    Join Date
    May 2005
    Location
    Sydney, Aust
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where exactly are you 'seeing' the '+' sign instead of %2B ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •