javascript - Always get empty result when call a ajax in my jquery -


I'm creating a plugin WooCommerce

In my plugin php file when I call a php file I get empty results with Jquery ajax

This is my Ajax code:

  jQuery (function () {jQuery.ajax ({url: '& lt? ? Php echo RAKHSH_WC_QUICK_VIEW_URL? & Gt; rakhsh-data-for-pop.php ', success: function (warning) {warning (output);}});});  

And this is my php file:

  & lt ;? Php $ output = 'test'; Return $ output; ? & Gt;  

You should change it:

  & lt ; ? Php $ output = 'test'; Return $ output; ? & Gt;  

To do this:

  & lt; Php $ output = 'test'; Die ($ production); // echo or print? & Gt;  

Returning to a variable will not return it as response to AJAX call.


Comments