This is what happens on event:
$(\'div#pages\').append($(\'...\'));
And then, on another eve
missed quotes on class name page
page
Also missed ) for append()
)
append()
Should be
$('div#pages').append($('...'));
instead of
$('div#pages').append($('...');