--- a/.gitignore +++ b/.gitignore @@ -33,4 +33,6 @@ .mr.developer.cfg .project .pydevproject + +*.*~ --- a/js/main.js +++ b/js/main.js @@ -1 +1,20 @@ +var template = _.template($('#image-template').html()); +$("#select").on('change',onSelectChange); +M = {}; +$.getJSON("http://localhost:60/js/maraa.json",function(data){ + M = data; + _.each(data.image_list, function(item) { + if(item.tag == "CR") + x = $('#imgs').append(template({ + img: item.image + }))}); +}); +function onSelectChange(e){ + $("#imgs").html(''); + _.each(M.image_list, function(item) { + if(item.tag == e.currentTarget.value) + x = $('#imgs').append(template({ + img: item.image + }));}); +}