Skip to content

Instantly share code, notes, and snippets.

@jimgwhit
Created January 4, 2015 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimgwhit/f6f8fa44a70ce048035f to your computer and use it in GitHub Desktop.
Save jimgwhit/f6f8fa44a70ce048035f to your computer and use it in GitHub Desktop.
json
$("#myTable td:nth-child(1)").click(function(event)
{
event.preventDefault();
var $td= $(this).closest('tr').children('td');
var currentCellText = $td.eq(0).text();
var CellText = $td.eq(1).text();
$.ajax({
url:'<?php echo "getowner";?>',
type: 'GET',
data: 'id='+currentCellText,
dataType: 'json',
success: function(data) {
alert(data.username);
window.opener.$('#firstName').val(data.firstname);
window.opener.$('#lastName').val(data.lastname);
self.close();
}
});
});// JavaScript Document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment