$.pjax demo without backend

Requests will not work, so showing an error message.

HTML

<html>
  <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="http://pjax.heroku.com/jquery.pjax.js"></script>
  </head>

  <body>
    <div id="valtozo">
      This will be replaced.
    </div>

    <a href="https://css-tricks.com/examples/State" data-pjax="#valtozo">Show news</a>
  </body>
</html>

JavaScript

$('a[data-pjax]').pjax(undefined, {
    error: function(jqXHR, textStatus, errorThrown) {
        alert("Could not use pjax!\n\n" + jqXHR + "\n\n" + textStatus + "\n\n" + errorThrown);
    }
});

$('body').bind('pjax:start', function(xhr, options) {
    $(options.container).fadeOut("fast", function() {
        alert("Faded out");
    });
}).bind('pjax:end', function(xhr, options) {
    $(options.container).fadeIn("fast");
});