Load body via AJAX in CMS

Hi Friends.
I am working on project which requires to load whole page via ajax. Is there a way where we can keep header and footer block fixed and just load main layout pages via Ajax.

Comments

  • wrap your main layout in a div with an id attribute.
    in the footer block, write an ajax call to a controller function to load the html into the div
    write a controller function that returns a view contents as a string
    $string = $this->load->view('myview', '', TRUE);
    echo out the correct headers for html
    echo out the $string

  • Thanks for reply @almostcompletely.
    Creating a new page also creates navigation with href to that page. How can I prevent that default redirection and call our ajax function which we made in footer instead?

Sign In or Register to comment.