querystring@1.0.x, querystring/1.0.x/
本模块提供URL参数序列化与反序列化接口
stringify ( data , [o] )
把数据序列化为URL参数
参数:
- dataObject|Array<Object<name,value>>
- 数据
- [o]Object
- 参数
- [o.encode=encodeURIComponent]Function
- 编码函数
返回值:
StringURL参数串
parse ( [qs] , [o] )
把URL参数反序列化为数据
参数:
- [qs]String
- URL参数,默认为当前窗口的location.search
- [o]Object
- 参数
- [o.decode=decodeURIComponent]Function
- 解码函数
- [o.dataType]String
- 返回数组类型,默认为Object,参数值为'array'时返回数组
返回值:
Object|Array<Object<name,value>>数据
append ( url , data , [o] )
把数据序列化为URL参数后添加到指定URL
参数:
- urlString
- URL
- dataObject|String
- 数据
- [o]Object
- 参数
- [o.encode=encodeURIComponent]Function(value)
- 编码函数
返回值:
String处理后的URL