Escape all special characters in a string that is sent by jquery ajax

前端 未结 5 618
自闭症患者
自闭症患者 2020-12-14 08:39

I am trying to send text in key value pairs while doing a contentType: \"application/json; charset=utf-8\", ajax post to a web service. The problem I am facing

5条回答
  •  离开以前
    2020-12-14 09:00

    For those who will find this question: Do not use escape method it has been removed from the Web Use encodeURIComponent() or encodeURI() instead
    encodeURIComponent()
    encodeURI()

提交回复
热议问题