Hello,
How can you create a multidimensional array with an each() loop?
The each function has to loop trough the .ui-selected object, and put all id’s and the offset in an array …
I hope somebody can help me because I’m searching all afternoon to fix this.
This is the code I was playing with .
[CODE]function sendAjax() {
var files = new Array();
$(‘.ui-selected’).each(function(index) {
var id = $(this).attr(‘id’);
var offset = $(this).offset();
files[index] = new Array();
files[index][‘id’] = id;
files[index][‘top’] = offset.top;
files[index][‘left’] = offset.left;
})
$.post(‘/testing/’, {‘files’: files},
function(data) {
// Testing purpose
alert(data);
}, ‘json’);
}
sendAjax();
Thanks!
Christophe