Defined but not used.
Sorry but I caught this due to error reporting so please look again.
It should be:
$.post( {
url: JQMH.ajaxurl,
data: $data
} );
To effectively pass the $data as data key.
Instead in the original code, $data is not passed, just data as a key