Clicking on div #some_id
calls details.php
but it doesn't succeed in retrieving data from jQuery. details.php
is supposed to echo 123
.
My goal is that when I click on div #some_id
, details.php
shows 123
in the browser.
html:
<div id="some_id">
<a href="details.php"> Details </a>
</div>
jQuery:
function detailsClick(){
$("#some_id").live('click', function(){
var data = {'myData': 123};
$.post('details.php', data);
});
}
details.php:
<?php
$idNumber = $_POST["myData"];
echo ($idNumber);
?>