There is a client side on JS. To send data to the server using AJAX. And before that, form the URL in which the given characters ' \ | . How to process them? encodeURIComponent() does not help. It turns out the URL /mySite/api/-9/2016-12-19T18:00:00.000Z/'%5C%7C and then AJAX falls into failure. If the characters are set apart separately, then everything works.

  • "Ajax falls into failure" is a very general description. See what happens in the Developer Tools Chrome, the Network and Console tabs. Maybe the problem is on the server side? - cronfy
  • No request to the server does not even reach. It crashes with the message is not the correct URL - 2felix
  • You have a single quote there before %5C%7C . What is she forgot in the url? - Visman
  • Because she can be there. The last characters are a comment or something else. But for some reason it is not encoded. - 2felix
  • one
    Show a message about an incorrect url. Desirable screenshot. - cronfy

1 answer 1

The backslash "\" is used for escaping service characters, most likely because of this, everything collapses. If you want to send a single character "\" in the string, then you must escape it, i.e. send two backslashes, instead of one "\\"