hi i'm having problems with my script
it won't show my djimages when my staff are on air
here's my js script
now my html script
could someone possible help
it won't show my djimages when my staff are on air
here's my js script
Code:
(function( d ) {
'use strict';
function onair(){
var dj = d.querySelector('#dj'),
nd = new Date(),
dy = nd.getDay(),
hr = nd.getHours(),
mn = nd.getMinutes();
if(( dy === 7 && hr === 18 && mn >=20 )||
( dy === 4 && hr === 18 && mn <=20 )||
{
dj.src='djimages/strawbs.png';
}
else {
if(( dy === 5 && hr === 13 && mn <=59 )||
( dy === 5 && hr === 14 && mn <=59 )) {
dj.src='djimages/deano.png';
}
else {
if(( dy === 6 && hr === 8 && mn <=59 )||
( dy === 6 && hr === 9 && mn <=59 )) {
dj.src='djimages/kayley.png';
}
else {
dj.src='djimages/off-air.jpg';
}
}
}
}
setInterval( function(){ onair();}, 1000 );
}( document ));
now my html script
Code:
<div align="center"><html>
<head>
<style>
p.one {
border-style: double;
border-color: white;
width: 256px;
height: 144px
}
</style>
</head>
<body>
<p class="one"><link rel="stylesheet" href="css/screen.css" media="screen">
<noscript>
<p>JavaScipt needs to be enabled for this page to function correctly</p>
</noscript>
<img id="dj" src="images/off-air.jpg" alt="Off-line" name="refresh" width="256" height="144">
<script src="scripts/showdj.js"></script></div></p>
</body>
</html>
could someone possible help