Loading fully themed node with Ajax - Drupal 7 I am loading node content to a specific div with Ajax. Is it possible to load a fully themed and rendered node (themed via page--node--1.tpl.php) with Ajax? 

I have a custom module controlling my Ajax functions. From what I understand, the code below should be returning a fully themed node - but it is not doing so:

function ajax_reader_init() {
    drupal_add_js('misc/jquery.form.js');
    drupal_add_library('system','drupal.ajax');
}

/**
 * Implements hook_menu()
 */
function ajax_reader_menu() {
    $items['ajax-reader'] = array (
        'page callback' =&gt; 'ajax_link_response',
        'access callback' =&gt; 'user_access',
        'access arguments' =&gt; array('access content'),
        'type' =&gt; MENU_CALLBACK
    );
    return $items;
}

function ajax_link_response($type = 'ajax', $nid = 0) {
    $output = _ajax_reader_load_noder($nid);
    if ($type == 'ajax'){
        $commands = array();
        $commands[] = ajax_command_replace('.main', '&lt;div class="main"&gt;'.$output.'&lt;/div&gt;');
        $page = array(
            '#type' =&gt; 'ajax',
            '#commands' =&gt; $commands
        );
        ajax_deliver($page);
    } else {
        $output = '&lt;div class="main"&gt;'.$output.'&lt;/div&gt;';
        return $output;
    }
}

function _ajax_reader_load_noder($nid = 0) {
    $node = node_load($nid);
    if($node) {
        $vnode = node_view($nid);
        return theme("node", $vnode);
    }
}
There is a contributed module Ajaxify Drupal with JQuery Ajax available for this. You can load any pages, nodes or anything to a div by using ajax without loosing css and ajax behaviour of loading content.


  Ajax links API module help you to load any content to a specified DIV or ajaxify whole drupal site, using JQuery Ajax. This module will also load JS for Ajax-loaded content by using Drupal.attachBehaviors(). In case you dont want to load js or css, you can alter tpl for path/node type.