开发者

JQuery equivalent in prototype

开发者 https://www.devze.com 2023-04-10 10:43 出处:网络
What is the form.serialize equivalent in JQuery if there is one? $(\'person-example\').serialize() // -> \'username=sulien&age=22&hobbies=coding&hobbies=hiking\'

What is the form.serialize equivalent in JQuery if there is one?

$('person-example').serialize()
// -> 'username=sulien&age=22&hobbies=coding&hobbies=hiking'

$('person-example').serialize(true)
// -> {username:开发者_JAVA技巧 'sulien', age: '22', hobbies: ['coding', 'hiking']}


It's the same, however you have to put # before your selector to select certain ID

$('#person-example').serialize();
0

精彩评论

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

关注公众号