On-air script


Joined
Jun 14, 2018
Messages
46
Reaction score
0
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



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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top