search

Home  >  Q&A  >  body text

javascript - The url parameter value has the special symbol "+", how to escape it?

The encodeURI() method is currently used in the project, so the encodeURI() function will not escape the following ASCII punctuation marks that have special meanings in URIs.

When the passed parameter value is "Qu", the server gets "Qu", and what it needs to get is 'Qu'. How to solve this problem?

typechotypecho2746 days ago956

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-07-05 10:46:04

    There are too many people stepping down, so let’s change to the formal method.
    encodeURIComponent or base64 can be used.

    reply
    0
  • 迷茫

    迷茫2017-07-05 10:46:04

    encodeURIComponent

    reply
    0
  • 漂亮男人

    漂亮男人2017-07-05 10:46:04

    encodeURI() function will not escape: ;/?:@&=+$,#
    but encodeURIComponent can

    reply
    0
  • 習慣沉默

    習慣沉默2017-07-05 10:46:04

    Base64 transfer down

    reply
    0
  • Cancelreply