[Solved] javascript inside an eternal loop php code doesnt work [closed]


Use only Javascript, I haven’t tested it:

<html>
<head>
</head>
<body>
<div>
<object width="100%" height="100%" id="liveTV_api" name="liveTV_api" 
data="http://www.extratv.gr/media/imgs/flowplayer-3.2.15.swf" type="application/x-shockwave-flash"><param 
name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="quality" 
value="high"><param name="bgcolor" value="#000000"><param name="flashvars" value="config={&quot;clip&quot;:{&quot;url&quot;:&quot;mpegts_256.stream&quot;,&quot;provider&quot;:&quot;rtmp&quot;,&quot;live&quot;:true,&quot;scaling&quot;:&quot;fit&quot;},&quot;plugins&quot;:{&quot;rtmp&quot;:{&quot;url&quot;:&quot;http://www.extratv.gr/media/imgs/flowplayer.rtmp-3.2.11.swf&quot;,&quot;netConnectionUrl&quot;:&quot;rtmp://213.16.167.186:1935/live&quot;,&quot;subscribe&quot;:true}},&quot;playerId&quot;:&quot;liveTV&quot;,&quot;playlist&quot;:[{&quot;url&quot;:&quot;mpegts_256.stream&quot;,&quot;provider&quot;:&quot;rtmp&quot;,&quot;live&quot;:true,&quot;scaling&quot;:&quot;fit&quot;}]}"></object>
<img id="adtv" src="https://stackoverflow.com/questions/26488622/img.png">
</div>

<script type="text/javascript">

function update() {
    var now = (new Date()).getHours(),
      start = 12,
      end = 13;

    if(now >= start && now <= end) {
        document.getElementById("adtv").style.display="none";
        document.getElementById("liveTV_api").style.display="block";
    }
     else {
        document.getElementById("adtv").style.display="block";
        document.getElementById("liveTV_api").style.display="none";
    }
}

// repeat interval in milliseconds
window.setInterval(update, 3600000);

update();

</script>

</body>
</html>

solved javascript inside an eternal loop php code doesnt work [closed]