Link to home
Start Free TrialLog in
Avatar of Nico2011
Nico2011Flag for United Kingdom of Great Britain and Northern Ireland

asked on

URL.Encode/Decxode Generating Error

Hello,

I am using this piece of code to encode and decode a URL:

<script language="javascript" runat="server">
URLDC = {
    encode : function(s){return encodeURIComponent(s).replace(/'/g,"%27").replace(/"/g,"%22")},
    decode : function(s){return decodeURIComponent(s.replace(/\+/g, " "))}
}
</script>

Open in new window


Encoding seems to work fine, however decoding doesn't, and generates this error:

Microsoft JScript runtime  error '800a01b6'

Object doesn't support this property or method

/deps/top-regions-data.asp, line 116

Assistance appreciated!

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Tony O'Byrne
Tony O'Byrne
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nico2011

ASKER

I am very sorry I did not respond before - I only found out that you had posted an answer when I requested assistance - the answer didn't show before!
Not to worry.  Glad I could help. :)
Thanks & have a good weekend :-)