I am trying to sort a JSON file into "bins" based on a file extension. So I have .txt and .jpg values. Here is a sample of the JSON:

Code:
{ files:{
     {
     "src": "images/jordan"
            },
           
            {
    "txt": "text/pope.txt"
    }, ...}
}
And here is the code I am using that doesn't work.

Code:
$(document).ready(function(){
               $.getJSON("data.json", function(data){
                $.each(data,function(){
                    $.each(this, function(key,value){
                        if (value == "*.jpg") {
                           
                       
                        $("#images").append(
                             '<img src=\"' + value.src + '\" height=\"150\">'
                        );} else{
                          $("#text").append(
                             '<p><a href=\"' + value.txt + '\">' + value.txt +
                             '</a></p>'
                        ); 
                        }
                    });
                });
               });
            });
Actually might it be better to sort the different file names into arrays first? Thanks for any insight.