The following changes should work:
$('#table tbody tr').on('click', function () {
var nTr = this,
img=$(this).find('td img')[0];
if (img.src.match('details_close') )
{
/* This row is already open - close it */
img.src = "../images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
img.src = "../images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
} );
The most likely reason you had issues with the .match()
call is because you replaced the direct Node access with a jQuery object, and that does not have a match method.