I've been looking at other questions related to my problem however none seem to correspond to my exact circumstances. I'm attempting to create a javascript variable which I will POST with Ajax to a PHP variable further down in my code. After hopefully setting the variable correctly I attempt to POST and var_dump the result however it is not the "0" I had hoped for but rather a frustrating bool(false). I've read that this may be a problem with the url (as I POST from the same file) or perhaps some other issue to do with the transfer of data to the Ajax request though I have as yet been unable to work out the issue. Testing for the data in the console also shows nothing so I've been forced to ask here. Thank you for any help or guidance.
Javascript
jQuery(document).ready(function(){var offset = parseInt("0");
$.ajax({url: 'index.php', type: 'POST', data: offset, success:function(data){return data;}});
});
PHP
<?php var_dump(isset($_POST['offset']));
'0'then change it on server side.