URL Decode HTML encoded in JavaScript

Discussion in 'ASP .Net' started by Ben Amada, Sep 30, 2005.

  1. Ben Amada

    Ben Amada Guest

    Hello. I have some HTML that I would like to pass to a popup webform via a
    querystring. I've run into some problems which I believe is because I need
    to encode the HTML. The popup webform is being created via JavaScript so I
    need to use JavaScript to encode the HTML. The problem is that I'm not sure
    if the URLDecode function in .NET is fully compatible with the encoding
    function in JavaScript.

    I found the following two JavaScript encoding functions:

    escape(param)
    encodeURI(param)

    I'm leaning towards using encodeURI as it is a newer, and probably more
    reliable function. Has anyone used the encodeURI function before with
    ..NET's URLDecode function? Do they work well with each other??

    TIA,
    Ben
     
    Ben Amada, Sep 30, 2005
    #1
    1. Advertisements

  2. Ben Amada

    Ben Amada Guest

    Ben Amada wrote:

    > escape(param)
    > encodeURI(param)
    >
    > I'm leaning towards using encodeURI as it is a newer, and probably more
    > reliable function.


    After some more testing, it seems as though the 'escape' function works
    better. Specifically with a # sign, encodeURI doesn't encode it at all
    which is giving me problems. 'escape', on the other hand, properly encodes
    the # to %23.

    So I guess my question now is, is .NET's URLDecode function fully compatible
    with JavaScript's 'escape' function? Is anyone else using anything else
    besides 'escape' that they've found works better?

    Thanks once again,
    Ben
     
    Ben Amada, Sep 30, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wolf
    Replies:
    0
    Views:
    853
  2. SHIRE
    Replies:
    4
    Views:
    3,354
    SHIRE
    Feb 4, 2004
  3. Mr. T

    decode base64 encoded login info

    Mr. T, Mar 5, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    707
    Patrice
    Mar 5, 2007
  4. John Dalberg

    How to decode this partially encoded string?

    John Dalberg, Mar 8, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    598
    John Dalberg
    Mar 8, 2007
  5. Mr. T

    decode base64 encoded login info

    Mr. T, Mar 5, 2007, in forum: ASP .Net Security
    Replies:
    0
    Views:
    288
    Mr. T
    Mar 5, 2007
  6. Ram
    Replies:
    0
    Views:
    970
  7. Stephan Mueller

    howto decode encoded mail subjects?

    Stephan Mueller, Aug 27, 2007, in forum: Ruby
    Replies:
    4
    Views:
    288
    Stephan Mueller
    Aug 29, 2007
  8. Dotan Cohen
    Replies:
    0
    Views:
    216
    Dotan Cohen
    Jun 13, 2013
Loading...