Preventing .ajax POST from navigating away

Preventing .ajax POST from navigating away

Hi everyone,

I am testing the following:

<?PHP
if(isset($_POST["Submit"]))
{
 echo "I am inside";
 some PHP code stuff.......
}
?>

<script>
$("#ftpForm").submit(function(event)
 {
 event.preventDefault();
  $.ajax({//Inside Ajax
method: "POST",
url: "index.html",
data: {Submit:"Submit", Data1:"data1", Data2:"data2", Data3:"data3"}
  })//Inside Ajax
 }); 
</script>

Apparently, the post seems to be occurring because the page leaves the tab that I am in and sends me
back to the 1st tab, which is the default.  I would like when the POST happens, to stay in the same tab I am
in. Is this possible and how?

Second, for some reason, my isset is not working properly, I know this is PHP stuff, but I was hopping someone here had knowledge and can see if I am doing something wrong?

Thanks,
Neil