You should attach .on
further up the tree and specify a selector (for existing and future elements) as an optional argument.
Instead of
$('a.pagehref').on('click', function(event)
{
// ...
});
attach .on
to document
$('document').on('click', 'a.pagehref', function(event)
{
// ...
});