AJAX function to load the content of the pages