Added loadPage function to retrieve resources and content.