How to process a JSON list to HTML

How to process a JSON list to HTML

My plan is to generate with PHP a list of image properties like

  1. "images": [
  2. { "imageURL":"images/5566_120512.jpg" , "alt":"Filler", "caption":"Caption" }, 
  3. { "imageURL":"images/5571_120520.jpg" , "alt":"Filler", "caption":"Caption" }, 
  4. { "imageURL":"images/5572_120530.jpg" , "alt":"Filler", "caption":"Caption" }
  5. ]
I am not sure about how to process the list with AJAX to produce

  1.       <a href="images/5566_120512.jpg" title="Filler"><img src="images/thumb/5566_120512.jpg" alt="Filler" caption="Caption"/></a>
  2.       <a href="images/5571_120512.jpg" title="Filler"><img src="images/thumb/5571_120512.jpg" alt="Filler" caption="Caption"/></a>
  3.       <a href="images/5572_120512.jpg" title="Filler"><img src="images/thumb/5572_120512.jpg" alt="Filler" caption="Caption"/></a>

The thumbnails have the same URL except that they will be in the sub-directory, thumb.

I believe I understand the basic AJAX syntax e.g.

  1. $(document).ready(function() {
  2. $.ajax({
  3. type: "GET",
  4. url: "json/mages.json", //json file 
  5. dataType: "json",
  6. success: function(json) {
  7. }
  8. )}
  9. )}
Though I am not sure about the dataType being "json".

Is there a reference that I have overlooked that discusses this topic?

Todd