I want to load a JSON file that creates a list inside Bootstrap Modal. I found where, if you click on the image of a person, the modal pops up.
<li class="project span3" data-type="pfa"> <a data-toggle="modal" data-target="#myModal" class="thumbnail"> <img src="img/anon.jpg" alt="Kenneth Atkins" /> <h1>Kenneth Atkins</h1> <p>[Description here]</p> </a> </li>
Here is an example of JSON data:
var florida_exoneration = [ { "last_name":"Atkins", "first_name":"Kenneth", "age":16, "race":"Caucasian", "state":"FL", "crime":"Sexual Assault", "sentence":"10 years", "conviction":2004, "exonerated":2008, "dna":"", "mistaken witness identification":"", "false confession":"", "perjury/false accusation":"Y", "false evidence":"", "official misconduct":"", "inadequate legal defense":"", "compensation":"" } ]
I would like the modal to display something like this inside the box:
Title = "first_name + last_name" Age = "age" Race = "race" State = "state" "" ""
I also want to make sure that the data is attached to the image, so the modality is not confused. Sorry if this is a bit confusing. I will try and clarify if anyone has any questions.
source share