admin管理员组

文章数量:1304266

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"});

本文标签: javascriptjQuery Object SerializationStack Overflow