under sub {
my $self = shift;
$self->layout(
$self->req->headers->header('X-PJAX')
? 'pjax' : 'default'
);
1;
};
<html>
<head><title><%= title %></title></head>
<body>
<div id="pjaxbody"><%= content %></div>
<%= javascript '/js/jquery.js' %>
<%= javascript '/js/app.js' %>
</body>
</html>
jQuery( function($) {
$("a.pjaxlink").pjax('#pjaxbody');
});
https://github.com/nqounet/p5-mojo-pjax