javascript - There are single quotes in interface parameters in Ajax, and the characters after the single quotes are lost
阿神
阿神 2017-06-12 09:32:01
0
1
547
var name = "name:Fu'an"
$.ajax({
  dataType: 'text',
  url: "get_top_count?query=" + name

You can see through the browser packet capture:
There is only this name:Fu

during transmission

So, now I want to ask how to deal with this single quote! ~
Thank you

阿神
阿神

闭关修行中......

reply all(1)
刘奇
escape("name:'a'")
"name%3A%27a%27"
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template