I have the following function which runs OK except for one thing. There is no consequence in what it appends first.
(function biograf(){
var placeholder = $('#top-imageholder');
$('ul#biomenu > li').each(function(){
var obj = $(this);
var pageLink = obj.find('a:first').attr('href');
$.get(pageLink, function(data) {
placeholder.append( $(data).find('#top-imageholder').html() );
placeholder.append( $(data).find('#top-imageholder').siblings('ul') );
});
});
})();
I would like the function to append the placeholder in the order my list items are placed in the #biomenu.
It does this 90% of the time, but once in a while it appends in different orders.
Any suggestions?
Well got it to work with the following code:
I'm not sure if this is the most optimal way, or if the code could be tweeked. But it works! :)
Thanks for all the replies though!
Order results with
$.when
(untested code):