check config and page object exists first
Merge pull request #6909 from guardian/ajax-fix

AJAX module fix