From b6709c017b79ce781e9638d7678c12d5fa3daa4e Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 3 Mar 2012 13:49:13 +0000 Subject: [PATCH] Examples: When the node to show the XHR return is not available, don't try to use it --- examples/examples_support/syntax/js/shCore.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/examples_support/syntax/js/shCore.js b/examples/examples_support/syntax/js/shCore.js index e23c0d6b..78b09ef0 100644 --- a/examples/examples_support/syntax/js/shCore.js +++ b/examples/examples_support/syntax/js/shCore.js @@ -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); + } } ); } } ); \ No newline at end of file