title: Dynamically assign values to IDs based upon AJAX content
body: <p>I have some javascript:</p>
  
  <pre><code>eval('var incomingJSON =' + ajaxObj.responseText);
  for (p in incomingJSON.common) {
      document.getElementById(p).value = incomingJSON.common.p;
  } 
  </code></pre>
  
  <p>where ajaxObject.responseText is:</p>
  
  <pre><code>{
      "common": {
          "item1": "1",
          "item2": "2",
          "item3": "3",
          "item4": "4",
          "item5": "5" 
      }
  }
  </code></pre>
  
  <p>The following line works:</p>
  
  <pre><code>document.getElementById(item1).value = incomingJSON.common.item1;
  </code></pre>
  
  <p>However, incomingJSON.common.p evaluates to "undefined".  The left side of the assign works fine.  What's the proper way to access the value in that object given the correct name?</p>