escape encodeURIComponent. escape URI. ( - , , .) encodeURIComponent URI. PHP , , :
var word = "balaji's";
$.ajax({
url: "yoururl",
data: encodeURIComponent("word") + "=" + encodeURIComponent(word)
});
If you do not send data in the default multipart form (for example, you override dataType), you will have to decode it yourself through . urldecode
source
share