I am doing some jquery ajax coding using jQuery.post. On my PC ( the pc I use to edit code through ftp ) the code works perfectly ( I already put the code live on external host/website ). But when I use my laptop or even my friends PC to check I always get -1 return.
This is the code I am using for .post
jQuery.post("<?php echo admin_url('admin-ajax.php'); ?>", data, function(response) {
alert('Got this from the server: ' + response);
});
// admin_url is wordpress function to return ajax located file
It even happen at my office. On the PC i was editing the code. I get the correct return value. But not when I use the other PC.
So I want to ask that
-
Is there any way to debug this -1
-
What could be problem with this kind.
when you get (-1) are you logged in?