AJAX doesn't work for "flag" field print in node.tpl
It might be too late to add the required JS in the node template.
Try adding your flag link to hook_preprocess_node in template.php instead.

e.g

function MYTHEME_preprocess_node(&amp;$vars){
  $vars['flag_link'] = flag_create_link('prova', $vars['node']-&gt;nid);
}


then in your node template

&lt;?php print $flag_link; ?&gt;