更新时间:2022-12-27 19:52:14
您可以这样做:
'blur .editable' : function () {
var target = event.currentTarget.value;
var field = event.currentTarget.name;
var obj = {};
obj[field] = target;
Hostings.update( { _id: this._id },{ $set: obj } );
}
可以通过两种方式访问Javascrip对象:
Javascrip objects can be accessed two ways:
object.attribute
或
object["attribute"]
如果使用第二种方法,则可以使用变量访问它
if you use the second method you can access it with a variable