Ajax not returning data after post call

Ajax not returning data after post call

I know there are tons of these questions out there but everything I try seems to fail. Im just sending a simple ajax call and expecting to get something back. Instead the call succeeds but I get no data back. Ideas why?

the javascript:
  1. jQuery(document).ready(function() {
  2. if(jQuery('#statesel').length) {
  3. var dataString;
  4. dataString = "nonce=" + dynoselect.post_dyno_select_nonce + "&tbl=state";
  5. jQuery.ajax({
  6. type: "POST",
  7. url: dynoselect.ajaxurl,
  8. dataType: "json",
  9. data: dataString,
  10. success: function(result) {
  11. alert(result.test);
  12. }
  13. });
  14. }
  15. });
the php:
  1. <?php
  2. function dyno_select() {
  3. $result['test'] = "HELLO";
  4. echo json_encode($result);
  5. }
  6. ?>