i have a problem with the each function.
HTML
<div id="d1" class="line1"></div>
JS
$(function() {
tt = new Array();
tt['id_32'] = new Array("32", "gudfgws", "htdfgss", "0", "gudfgdgfs", "0", "halder", "0");
tt['id_35'] = new Array("35", "TVdfg.xml", "154", "Was läuft jetzt im TV", "0", "simpsons", "0");
tt['id_36'] = new Array("36", "Gddfge", "httdfg0", "155", "Idfgs", "0", "apple", "0");
$.each(tt, function(key1,key2)
{
$('#d1').append('-> '+key1+' - '+key2+' <br />');
});
});
I dont get anything … no error and no results. Can anybody tell me where the bug is?
Working example
http://www.jsfiddle.net/V9Euk/558/
Thanks in advance!
Peter
You’re using named indexes with an array which doesn’t work, you need
ttto be an object instead, like this:Here’s the updated/working version.