i have a quick question. I want to iterate over all checked checkboxes and parse the json files for the checked ones.
Here is my problem: The $().each function is synchronous and the $.getJSON() function is asynchronous. So i know i would have to pause the exectuion of the each() loop until the JSON File is parsed. How can i pause the loop? Or any other ideas solving this problem?
Thank you very much.
$("input:checkbox[name=check]:checked").each(function()
{
    $.getJSON( $(this).val(), function( data ) {
        //Do smth.
        //Pause the each loop?
    }).error(function(jqXhr, textStatus, error) {
            alert("ERROR: " + textStatus + ", " + error);
    });
}); 
alert("foo"); //<-- gets executed before all json files are parsed.
 
    