• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

javascript issue

772
Posts
13
Years
  • Age 35
  • UK
  • Seen Apr 19, 2024
I have a page (the whole source code can be found here: http://wgcscouts.co.uk/ncubs.php)
where i'm trying to make a rotating image, but nothing is coming up

The javascript is
Code:
<script language="JavaScript" type="text/javascript" >// JavaScript Document var idx=0; 
    var links=[{img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-011.jpg", 
            url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-011.jpg"}, 
            {img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-015.jpg", 
            url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-015.jpg"}, 
            {img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-030.jpg", 
            url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-030.jpg"}, 
            {img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-040.jpg", 
            url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-040.jpg"}]; 
 
    function setImage() 
    { 
     
        var link=document.getElementById("changing_link"); 
        var img=document.getElementById("changing_image"); 
            alert(link); 
        link.href=links[idx].url; 
        img.src=links[idx].img; 
         
        ++idx; 
        if(idx==links.length) 
            idx=0; 
         
        window.setTimeout(setImage,1000); 
    }</script>

the alert comes back as null

Anyone any ideas
 
152
Posts
15
Years
It seems to be working fine for me, except for one picture which it can't find. Did you already fix it?
 
772
Posts
13
Years
  • Age 35
  • UK
  • Seen Apr 19, 2024
yeah, not too long ago, i just hadn't got round to fixing it. The issue was the javascript was being called before the page had finished loading
 
Back
Top