开发者

jQuery Object Serialization

开发者 https://www.devze.com 2022-12-09 21:42 出处:网络
If I\'ve for example an object like: {start: 1, end: 2, someString=\"someStringValue\"} I开发者_如何学Gos there any simple way to serialize it into a string of data? Example:

If I've for example an object like:

{start: 1, end: 2, someString="someStringValue"}

I开发者_如何学Gos there any simple way to serialize it into a string of data? Example:

start=1&end=2&someString=someStringValue

Thanks.


You can use the param() function:

var str = jQuery.param({start: 1, end: 2, someString: "someStringValue"});
0

精彩评论

暂无评论...
验证码 换一张
取 消