ultra simple code: why is not popping the alert window?

ultra simple code: why is not popping the alert window?

  1. I click on an 'a' link tag and the value does get passed to the var selectedlanguage, but then continuing down the code, the "alert" does not pop when supposedly returning from the Controller. Looks like it does not get this far.


  2. <script>
  3.     $(document).ready(function(){
  4.         $('.choose-language').on('click', function()
  5.        
  6.         {
  7.             var selectedlanguage = $(this).data('value');
  8.             $url = '{{URL::route('languagechooser')}}';
  9.             $.post($url,
  10.                   {'locale': selectedlanguage},
  11.                   function(data){
  12.               alert("hello");
  13.              
  14.                   }); // HERE FINISHES THE $.POST STUFF           
  15.            
  16.         }); //HERE FINISHES THE CLICK FUNCTION       
  17.        
  18.     }); // HERE FINISHES THE DOCUMENT AND READY STUFF
  19.     </script>