Skip to content

Instantly share code, notes, and snippets.

@Sinetheta
Created March 12, 2012 16:13
Show Gist options
  • Save Sinetheta/2023047 to your computer and use it in GitHub Desktop.
Save Sinetheta/2023047 to your computer and use it in GitHub Desktop.
JS: DataTables addons
$.fn.dataTableExt.ofnSearch['html'] = function ( sData ) {
var n = document.createElement('div');
n.innerHTML = sData;
if ( n.textContent ) {
return n.textContent.replace(/\n/g," ");
} else {
return n.innerText.replace(/\n/g," ");
}
}
$.fn.dataTableExt.ofnSearch['html'] = function ( sData ) {
var n = document.createElement('div');
n.innerHTML = sData;
if ( n.textContent ) {
return n.textContent.replace(/\n/g," ");
} else {
return n.innerText.replace(/\n/g," ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment