0
我想創建一個簡單的數組像item_structure = {thumb, head, cont}
這裏是我的代碼:簡單的JSON陣列
$('.items_options').find('#'+item_id+' .option .blog_item_structure li')
.each(function(event) {
var item_class = $(this).attr('class');
item_structure[] = item_class;
});
但似乎expresion item_structure[] = ...
不工作。那麼你們中的任何人都知道什麼是rigt語法?
Thx爲您的時間。
這有什麼好做JSON。你只需要學習數組如何在JavaScript中工作,這應該在每一個好的教程中介紹。例如:https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Predefined_Core_Objects#Array_Object或http://eloquentjavascript.net/chapter4.html。 –
item_structure = {thumb,head,cont}不是JSON – cggaurav
Thx它幫了很多:) –