node.js querystring處理參數

C:\Documents and Settings\Administrator\WebstormProjects\untitled6>node
> url
{ parse: [Function: urlParse],
resolve: [Function: urlResolve],
resolveObject: [Function: urlResolveObject],
format: [Function: urlFormat],
Url: [Function: Url] }
> querystring
{ unescapeBuffer: [Function],
unescape: [Function],
escape: [Function],
encode: [Function],
stringify: [Function],
decode: [Function],
parse: [Function] }
> querystring.stringify({name:'scoot',course:['jade','node'],from:''})
'name=scoot&course=jade&course=node&from='node

> querystring.stringify({name:'scoot',course:['jade','node'],from:''},',')   //鏈接符所有換成了','
'name=scoot,course=jade,course=node,from='url

> querystring.stringify({name:'scoot',course:['jade','node'],from:''},',',':')   //等號換成了':'
'name:scoot,course:jade,course:node,from:'spa

 

 

 

轉移與反轉義code

相關文章
相關標籤/搜索