How to use URL-based AJAX in Drupal 7 to serve all pages? I know this can be done through jQuery alone, but I'm interested in knowing if there any Drupal 7 ways of achieving this:

I want to use AJAX to serve all non-admin pages on my site. Also I don't want it to just replace parts of a page, but load entire pages over AJAX. The AJAX Framework allows loading partial contents over AJAX based on various triggers. But I want to make a URL based navigation system.

Here are the things I want to accomplish:


Redirect http://example.com/node/1 to http://example.com/#!/node/1. So search engines can index the node normally.
Drupal reads the string from URL (node/1) and fetches the relevant string in json format.
Insert the resulting data into page and replace existing content.
Refreshes blocks that should appear on the corresponding page.
Refreshes title in browser (optional).
Needs to work with Panels.


If I create a new module, what functions and/or frameworks in Drupal can I use to make this work?

Thanks.

-Kaustav
I'm searching also a solution to do that. I would like to allow users to choose witch content type is displaying in a region. 

I started by create one block by region and inside I put different functions like the following one to get different content.

node_view_multiple(array($node-&gt;nid =&gt; $node), $display_type); // To get a node.
module_invoke($module, 'block_view',$delta); // To get a block.
panels_mini_block_view($minipanel_name); // To get a mini panel.


Now, with the CSS ID of the block, I will try to refresh them using AJAX link.
I think I will have to override all the links of Drupal to somethings like main/nojs/#div_region_id/[drupal-url] (e.g. main/nojs/block-content/node/1) and add them a class="use-ajax".

The management what is refresh will be in ajax_callback_response().     

$commands[] = ajax_command_html('#block-content', $output );
$page = array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);
ajax_deliver($page);


Another way may be also with the Content page module.