Note that there are some explanatory texts on larger screens.

plurals
  1. POinsert the json parsed values into tables
    text
    copied!<p>helo i have tried hard in styling the json values that are printed randamoly in page ,here that are 4 categories,what i am doing with javascript is finding the lenght of the json array containing many objects ,then taking the type id ,as it is common in all array ,to determine whether they belong to 0,1,2,3 category ,then printing all the elements in the json array and so on ,here i would like to create table for each category and push all the corresponding id's to the table rows.</p> <pre><code>var txt = '&lt;?php echo $response ?&gt;'; //alert(txt); //var jsonData = eval ("(" + txt + ")"); var jsonData = JSON.parse(txt); for (var i = 0; i &lt; jsonData.account_detail.length; i++) { var counter = jsonData.account_detail[i]; //console.log(counter.counter_name); //alert(counter.type); document.write("&lt;table border="0" width="500&gt;"&gt;") if(counter.type=="0") { document.write(counter.building_name); document.write(counter.org_name); document.write(counter.user_name); document.write(counter.name); document.write(counter.loc_name); document.write(counter.email_id); document.write(counter.password); } if(counter.type=="1") { document.write(counter.user_name); document.write(counter.name); document.write(counter.password); document.write(counter.email_id); } if(counter.type=="2") { document.write(counter.building_name); document.write(counter.org_name); document.write(counter.user_name); document.write(counter.opr_code); document.write(counter.name); document.write(counter.loc_name); document.write(counter.email_id); document.write(counter.password); } if(counter.type=="3") { document.write(counter.building_name); document.write(counter.org_name); document.write(counter.machine_type); document.write(counter.activate_status); document.write(counter.machine_name); document.write(counter.entrance_exit_name); document.write(counter.entrance_or_exit); document.write(counter.loc_name); document.write(counter.activation_code); } } document.write("&lt;/table&gt;") </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload