1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-11-29 11:24:10 +01:00

Examples: When the node to show the XHR return is not available, don't try to use it

This commit is contained in:
Allan Jardine 2012-03-03 13:49:13 +00:00
parent cc42c49ec3
commit b6709c017b

View File

@ -2698,11 +2698,13 @@ $(document).ready( function () {
if ( $.fn.dataTableSettings.length >= 1 ) {
$('#example').dataTable().bind('xhr', function ( e, oSettings ) {
var n = document.getElementById('latest_xhr');
n.innerHTML = JSON.stringify(
JSON.parse(oSettings.jqXHR.responseText), null, 2
);
n.className = "brush: js;"
SyntaxHighlighter.highlight({}, n);
if ( n ) {
n.innerHTML = JSON.stringify(
JSON.parse(oSettings.jqXHR.responseText), null, 2
);
n.className = "brush: js;"
SyntaxHighlighter.highlight({}, n);
}
} );
}
} );