Need to send AJAX data with get parameters from php variable
<?php
$startdate="2017-11-23 14:32:00";
?>
<script>
setInterval(function() {
$("#load").load("loader.php", {startdate:<?php echo $startdate;?>});
}, 10000);
</script>
loader.php
<?php
$startdate=$_POST['startdate'];
?>
<script>
$("#load").empty();
$("#load").html('<?php echo $startdate;?>');
</script>
But nothing returns to block "load". Where is my fault? Thanks!
.load()Load data from the server and place the returned HTML into the matched element. does not send. you might wanna try.post()or.get()