0
我想用AND条件创建一个Json对象(我不知道它是否可能)。我把目前为止我未完成的代码。Json对象条件
var parameters = {
Title : "hello",
Text : "world",
Question : //if two checkboxes are checked then true else false.
}
关于两个复选框选中我想使用这个:
$('.checkbox1').is(':checked') && $('.checkbox2').is(':checked')
什么,我想,以避免被放了,如果像
//if checkboxes are checked
//{
//create the json object of type 1
//}
//else
//{
//create the json object of type 2
//}
这可能吗?
您刚刚尝试过吗?顺便说一句。这是**不是** JSON对象。这是一个普通的JavaScript对象。 – 2011-05-06 10:07:56