Calling a block by AJAX I want to call a block on a page by AJAX. This is appearing in content and not in a block region.

[Use case: I have a View listing countries and their details; I want to add, at the top of the View, the user's country. I want the page to be cached, hence using AJAX to call back a View Block]

In the header of my view I have:

&lt;div id="load-ajax"&gt;&lt;/div&gt;
&lt;script&gt;
(function ($) {
  $('#load-ajax').load('/example/test');
}) (jQuery);
&lt;/script&gt;


In hook_menu I have

$items['example/test'] = array(
    'title' =&gt; 'AJAX Delivery Test', 
    'page callback' =&gt; 'show_example_block', 
    'delivery callback' =&gt; '_basic_print', 
    'access callback' =&gt; TRUE, 
    'type' =&gt; MENU_CALLBACK,
  );


I then have two functions:

function _basic_print($page_callback_result){
  print $page_callback_result;
}

function show_example_block(){
  if (isset($_COOKIE['country'])){
    return views_embed_view('example', 'example_block', $_COOKIE['country']);
  }
}


This works fine, but I'm wondering whether I'm missing anything. Is there a simpler, slightly more native way of doing this?
&lt;?php
$block = module_invoke('module_name', 'block', 'view', 0);
print $block['content'];
?&gt;


Try including the view block.