最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery Object Serialization - Stack Overflow

programmeradmin2浏览0评论

If I've for example an object like:

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

Is there any simple way to serialize it into a string of data? Example:

start=1&end=2&someString=someStringValue

Thanks.

If I've for example an object like:

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

Is there any simple way to serialize it into a string of data? Example:

start=1&end=2&someString=someStringValue

Thanks.

Share Improve this question asked Oct 28, 2009 at 19:48 Alon GubkinAlon Gubkin 57.1k57 gold badges199 silver badges290 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

You can use the param() function:

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

评论列表(0)

  1. 暂无评论