how to hide spinner after the content loads
问题 I'm using pjax to load content and while the content is loading, I show a spinner: $('a[data-pjax]').pjax().live ("click", function () { $("#loader").show(); }); This works fine, however, after the content loads the loader still stays there. Where should I call $(#loader).hide() to hide the loader after the content has loaded? 回答1: According to the doc https://github.com/defunkt/jquery-pjax $(document).on('pjax:complete', function() { $("#loader").hide() }) I think you can also use pjax:end