Skip to content

Instantly share code, notes, and snippets.

@cohitre
Created April 15, 2009 03:03
Show Gist options
  • Save cohitre/95578 to your computer and use it in GitHub Desktop.
Save cohitre/95578 to your computer and use it in GitHub Desktop.
$("tr.dataline").click(function ()
{
$.getJSON("test.php",{wid:id},
function(data){
var table = $("<table class='user'><tbody><tr><th>Netid</th><th>Last</th><th>First</th><th>Email</th><th>Completed</th><th>Certificate Sent</th><th>Date</th></tr></tbody></table>");
jQuery.each(data.roster, function(i, roster) {
var row = $("<tr />");
var properties = ["netid","lastname","firstname","email","completed","certificate_sent","date"];
$.each( properties , function(i,property){
row.append("<td>"+roster[property]+"</td>");
} );
table.find("tbody").append(row);
});
$('#rosterDisplay').append(table);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment