0
意圖創建一個js嵌套對象給出語法錯誤。什麼可能導致錯誤?語法錯誤JavaScript嵌套對象
window.thePosts =
{
'ITEM1':
{
'SUB1' :
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'}
},
'SUB2' :
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'}
}
},
'ITEM2':
{
'SUB1' :
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MAKING MONEY','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'}
},
'SUB2' :
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'},
{'id:':'1','name': 'MARKETING','the_cont': '<img src="/wp-content/assets/images/pop1.jpg">'}
}
}
};
' 'SUB1':'這裏沒有左括號。 – Mics