How do you pass an apostrophe through a URL?

后端 未结 4 765
时光取名叫无心
时光取名叫无心 2020-12-29 03:43

I\'m using Node.js:

var s = \'Who\\\'s that girl?\';
var url = \'http://graph.facebook.com/?text=\' + encodeURIComponent(s);

request(url, POST, ...)
         


        
4条回答
  •  情话喂你
    2020-12-29 04:08

    You can encode the single quote as specified in this link http://www.w3schools.com/TAGS/ref_urlencode.asp

提交回复
热议问题