For help! Killed 8 hours, the result - 0. There is a code:
<script type="text/javascript"> var tt = 0 var d = new Date(); var n = d.getTime()/1000; var s = <?php echo $_SERVER['REQUEST_TIME']; ?>; var lefin = (n - s)/60/60; if (lefin >= -0.1) { var tt = 1 } if (lefin < -0.1) { var tt = 2 } if (tt == 1) { function ajaxCall(tt) { alert("To AJAX: CHECK "+tt); jQuery.ajax({ type: "POST", url: "wp-content/plugins/UFR/script.php", dataType: 'json', data: "param="+10, success: function(response) { alert("yoyo")} } ); }; ajaxCall(tt); } console.log(n); console.log(lefin); console.log(tt); </script> and the script file:
<?php $timedf = json_decode($_POST['param']); ?> According to the idea, the $ timedf variable should now be available on my page - but all is in vain. Who knows what's the matter, help
response. And in the php file, I would doecho json_encode(что-то там);- user242433success: function(response) { alert(response); }success: function(response) { alert(response); }- user242433