Pjax will not allow me to specify functions as an option when called directly.
$(document).on('click', 'a.inferno-preview', function(event) { return $.pjax.click(event, { container: '#preview-overlay', fragment: '#preview-overlay', send: function() { return $('#preview-overlay').removeClass('hidden'); }, complete: function() {} }); });
In this case, the send and complete functions are not executed, and the container and fragment work well. Why is this and what do I need to do to make Pjax recognize my functions?
By the way: I canβt use the usual form of using Pjax , I need more control over what is happening, so I need to use $ .pjax. click an object. However, this will work normally with functions in a general way, as in the following:
$(document).pjax('a.inferno-preview', '#preview-overlay', { send: function() { alert('this will work.'); } });
source share