Здравствуйте!
Не могу заставить обновляться сравнение полученных по AJAX данных
В остальном все работает как задумано
Прошу помочь
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; Charset=UTF-8"/>
<script type="text/javascript" src="/js/jquery-3.4.1.js"></script>
<style type="text/css">
<!--
.showhide {
display:none;
}
.showhide2 {
display:block ;
}
-->
</style>
</head>
<body>
<div id="showhide" class="showhide" >РАВНО</div>
<div id="showhide2" class="showhide2" >не равно</div>
<script>
function getReleaseNum()
{
var value = 0; //значение по умолчанию
response = $.ajax({
type: 'POST',
url: 'get_release.php',
async: false,
data: {type:'request'},
dataType: 'json',
}).responseText;
values = response;
return values;
}
var ajaxReleaseData=getReleaseNum();
/////
if( <?php
echo '1760603777';
?> == ajaxReleaseData ) {
$('#showhide').show();
$('#showhide2').hide();
} else {
$('#showhide').hide();
$('#showhide2').show();
}
/////
$(document).ready(function(){
getReleaseNum();
setInterval('getReleaseNum()',1000);
});
</script>
</body>
</html>