title: parsing json multiple array with unknown field names with jquery
body: <p>I have json data that looks like this</p>
  
  <pre><code>    {  
     "projects":{  
        "COMMERCIAL":[  
           {  
              "ppID":"87",
              "pTitle":"5th Street Lofts"
           },
           {  
              "ppID":"94",
              "pTitle":"Skip-a-Long Child Development Services"
           }
        ],
        "CORPORATE":[  
           {  
              "ppID":"86",
              "pTitle":"Caxton Building"
           },
           {  
              "ppID":"68",
              "pTitle":"Swiss Valley Corporate Headquarters"
           }
        ],
        "EDUCATION (COLLEGIATE)":[  
           {  
              "ppID":"20",
              "pTitle":"Ashford University - Athletic Field"
           },
           {  
              "ppID":"64",
              "pTitle":"St. Ambrose University - Center For Health And Science Education"
           }
        ]
     },
     "error":"0"
  }
  </code></pre>
  
  <p>In this example, "COMMERCIAL", "CORPORATE", and "EDUCATION (COLLEGIATE)" are unknown fields names.</p>
  
  <p>I'm getting it from my CGI, which looks like this:</p>
  
  <pre><code> $.ajax({    
          url: "cgi/myCGI.exe",    
          dataType: "json",           
          error: ajaxError,           
          success: function(json){   
  
              if(json.error !== "0"){                                                                 
                  alert("error processing request: "+json.error);
                  return;
              }
  
              var temp="";
              var i=0;
              for(i=0;i&lt;=json.projects.length-1;i++){                     
                  // tried something like this
              }
  
              $.each(json.projects, function(ppID, pTitle) {
                   // tried something like this
              });                 
  
               // add to my html
  
          }
    });   
  </code></pre>
  
  <p>Ultimately, I want to add HTML to the webpage,
  like</p>
  
  <pre><code>&lt;div class="smSubTitle"&gt;COMMERCIAL&lt;/div&gt; 
  &lt;a href="somePage.html?id=87"&gt;Fidlar Technologies&lt;/a&gt;&lt;br&gt;
  &lt;a href="somePage.html?id=94"&gt;Skip-a-Long Child Development Services&lt;/a&gt;&lt;br&gt;
  &lt;div class="smSubTitle"&gt;CORPORATE&lt;/div&gt; 
  </code></pre>
  
  <p>etc.</p>
  
  <p>I can't figure out how to get the names of each project "sub title" then it's individual field values.</p>
  
  <p>EDIT:
  First, I noticed that json.projects.length is undefined.
  I also tried json.projects[0].length but it is also undefined.</p>
  
  <p>in</p>
  
  <pre><code>            $.each(json.projects, function(ppID, pTitle) {
                  console.log("test: "+ppID);
                  console.log("test: "+pTitle);
              }); 
  </code></pre>
  
  <p>ppID works, but pTitle says [object,object]</p>