我正在尝试动态生成JSON,但当我像这样做时:
var jsonVar = {
"section": {}
}
var elementsStoragePrefix = "_app_",
elementName = elementsStoragePrefix + "some_name";
$.extend(jsonVar .section, { elementName: "<option>This is a text</option>"});
我得到的密钥是elementName而不是_app_some_name
jsonVar.section =>
Object
elementName: "<option>This is a text</option>"
__proto__: Object