Making an ajax request from a different domain
If you want to use Admin-Ajax to output the content, you should use echo instead. There is nothing to be viewed when you use return, so you’ll get a 0. This quotation from the codex explains further about the 0 response: If the Ajax request fails in wp-admin/admin-ajax.php, the response will be -1 or 0, … Read more