javascript noscript question

by 2 replies
3
I'm trying to figure out how to handle this and am left scratching my head. I can put a noscript in here so it will show a single image if javascript is disabled, the noscript is easy enough, but how do you hide the javascript img so i don't get the missing image (red x)? I don't think php can detirmine if JS is on or off so...

Here's the code, any suggestions greatly appreciated

PHP Code:
<img src="" name="Rotating" id="Rotating1"/>

<
script language="JavaScript">
  var 
ImageArr1 = new Array("1.jpg","2.jpg","3.jpg");
  var 
ImageHolder1 = document.getElementById('Rotating1');
  
  function 
RotateImages(whichHolder,Start)
  {
      var 
a = eval("ImageArr"+whichHolder);
      var 
b = eval("ImageHolder"+whichHolder);
      if(
Start>=a.length)
          
Start=0;
      
b.src = a[Start];
      
window.setTimeout("RotateImages("+whichHolder+","+(Start+1)+")",2500);
  }
  
  
RotateImages(1,0);
</script> 
#programming #javascript #noscript #question
  • Well, you will need to insert the image with JavaScript, if you don't want it to display when JavaScript is disabled. Do you need help figuring out how to do that?
    • [1] reply
    • Thanks wayfarer, no I can get it. So simple I can't believe I didn't think of that
  • Banned
    [DELETED]

Next Topics on Trending Feed

  • 3

    I'm trying to figure out how to handle this and am left scratching my head. I can put a noscript in here so it will show a single image if javascript is disabled, the noscript is easy enough, but how do you hide the javascript img so i don't get the missing image (red x)? I don't think php can detirmine if JS is on or off so... Here's the code, any suggestions greatly appreciated