我正在尝试动态创建 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