jquery ajax beforeSend not working.

jquery ajax beforeSend not working.

Hi,
I have a problem using ajax beforeSend.
I execute a php file using this:
<li><a href="#" onclick="window.open(file.php?c=<?php echo $c?>&m=<?php echo $m?>')">Registro personale</a></li>

in file.php there is a control:
 if (isset($_GET['c']))
     {    
           $a1 = $_GET['c']; 
           $a2 = $_GET['m'];
           $a3 = 0;
              
         echo "<script type=\"text/javascript\">\n";
?>
         inviaClasse('<?php echo $a1?>','<?php echo $a2?>','<?php echo $a3?>','<?php echo $sessione?>');
<?php
         echo "</script>\n";   
     }

Then  inviaClasse function I send a ajax request, but beforeSend not working. Success is ok.
$.ajax({
  type: 'POST',
  url: "registroQuadri1.php",
  data: {a:arg1, b:arg2, c:arg3},
  
  beforeSend: function(xhr){
      $("#esegui").dialog({
        "title": "RegistroOnWeb - Waiting -",
        height: 1540,
        width: 430,   
        cache: false
      })
  },
 
  success: function(msg){
    $("#risulta").html(msg);
    $(".ui-dialog-content").dialog("close");
    datiJQuery(arg4);
  }
});

Please can some one helps me?

Thanks in advance.

Tegatti