title: display data in html through an AJAX success method
body: <p>i am writing the below code for displaying data in html table returned from database in json format</p>
  
  <pre><code>success : function(data){
              alert("declaring variable");
              var output="&lt;table id=tableStyle&gt;";
              alert("creating output");
              output+="&lt;tr&gt;" + "&lt;th&gt;" + "REPORTSUITE_ID" + "&lt;/th&gt;" + "&lt;th&gt;" + "REPORTSUITE_NAME" + "&lt;/th&gt;" + "&lt;th&gt;" + "STAGING_DATABASE" + "&lt;/th&gt;" + "&lt;th&gt;" + "DWH_DATABASE" + "&lt;/th&gt;" + "&lt;/tr&gt;";
              alert("starting for loop"); 
              for (var i in data)
              {
                  output+="&lt;tr&gt;" + "&lt;td&gt;" + data[i].REPORTSUITE_ID + "&lt;/td&gt;" + "&lt;td&gt;" + 
        "&lt;button&gt;"+data[i].REPORTSUITE_NAME + "&lt;/button&gt;" +
        "&lt;/td&gt;" + "&lt;td&gt;" + data[i].STAGING_DATABASE + "&lt;/td&gt;" + "&lt;td&gt;" + data[i].DWH_DATABASE + "&lt;/td&gt;" + "&lt;/tr&gt;";
              }
              output+="&lt;/table&gt;";
              alert ("displaying now ");
              document.getElementById("placeholder").innerHTML=output;
            }
  </code></pre>
  
  <p>The data format in JSON is as follows:</p>
  
  <pre><code>[{"DWH_DATABASE": "abc", "REPORTSUITE_ID": 51, "REPORTSUITE_NAME": "C1","STAGING_DATABASE": "def", "TRANS_TABLE": "T1"}, 
  {"DWH_DATABASE": "abc", "REPORTSUITE_ID": 49, "REPORTSUITE_NAME": "C2", "STAGING_DATABASE": "def", "TRANS_TABLE": "T2"}, 
  {"DWH_DATABASE":"abc", "REPORTSUITE_ID": 40, "REPORTSUITE_NAME": "C3", "STAGING_DATABASE": "def", "TRANS_TABLE": "T3"}]
  </code></pre>
  
  <p>When i execute the above code, i get the result as follows:</p>
  
  <pre><code>REPORTSUITE_ID  REPORTSUITE_NAME    STAGING_DATABASE    DWH_DATABASE
  undefined         undefined          undefined         undefined
  undefined         undefined          undefined         undefined
  undefined         undefined          undefined         undefined
  </code></pre>
  
  <p>Please tell me how to display the data correctly</p>