diff --git a/js/api/api.ajax.js b/js/api/api.ajax.js index 49aa7be13..99c28da5c 100644 --- a/js/api/api.ajax.js +++ b/js/api/api.ajax.js @@ -1,6 +1,11 @@ var __reload = function ( settings, holdPosition, callback ) { + // Not an ajax source - abort + if ( settings.ajax == null ) { + return; + } + // Use the draw event to trigger a callback if ( callback ) { var api = new _Api( settings ); diff --git a/js/core/core.ajax.js b/js/core/core.ajax.js index 7ba6b4115..cf4c5f5ba 100644 --- a/js/core/core.ajax.js +++ b/js/core/core.ajax.js @@ -76,6 +76,7 @@ function _fnBuildAjax( oSettings, data, fn ) // Remove the data property as we've resolved it already and don't want // jQuery to do it again (it is restored at the end of the function) + ajax.data = null; // or undefined - for IE / Safari delete ajax.data; } @@ -136,8 +137,10 @@ function _fnBuildAjax( oSettings, data, fn ) // Object to extend the base settings oSettings.jqXHR = $.ajax( $.extend( baseAjax, ajax ) ); - // Restore for next time around - ajax.data = ajaxData; + if (ajax && ajaxData) { + // Restore for next time around + ajax.data = ajaxData; + } } }