I have some divs
and need to store data of each div
in a array. So i used a two dimensional array to store these data in following way.
this.saveBoardAndNotes = function (board_id, board_name) {
var noteList = new Array(new Array());
var self = this;
var count = 0;
$(".optimal-sticky-notes-sticker-note").each(function(){
// Replace plain urls with links and improve html
var note = $(this);
var content = note.find(".textarea").html();
var properties = JSON.stringify(self.getProperties(note));
var noteID = note.attr("id");
noteList[count]['content'] = content;
noteList[count]['properties'] = properties;
noteList[count]['noteID'] = noteID;
count++;
});
But i get following error in firebug when i try to store more than one div in array
TypeError: noteList[count] is undefined
How can i solve the problem. By the way, is there any optimized way? Thanks in advance.