Thanks a lot for your quick response . I had try with your code, the issue is that when a call the “ajax_var.action” is due to I included that statement inside the plugin in the enqueue scripts action. I think is better to do this
url: the url of the plugin,
data: ‘action= the name of the php hook or action’,
Like you can see I delete de nonce because if I don’t use the enqueue action, I am not able to create a nonce inside the js code.
I feel glad with your comments about this.
Thanks again for your support.