Skip to content

Instantly share code, notes, and snippets.

@ioseb
Created May 13, 2009 10:32
Show Gist options
  • Save ioseb/110964 to your computer and use it in GitHub Desktop.
Save ioseb/110964 to your computer and use it in GitHub Desktop.
$('table.board').click(function(e) {
var target = e.target;
if (target.nodeName == 'TD') {
var params = {
rowIndex: target.parentNode.sectionRowIndex,
cellIndex: target.cellIndex
};
$.getJSON(
'http://yourdomain.com/movechecker.py',
params,
function(data) { //callback function
var allowed = data.allowed || false;
if (allowed === true) {
target.appendChild(previouslySelectedDIVElement);
target = null;
}
}
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment