SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant figure out the problem...

    I have this code, what should take the next picture, when you click on it, but it doesnt work:
    <html>
    <head>
    <title>Slideshow</title>
    <script>
    function loaded(){
    var solarion=1;
    document['goljat'].src="serrors/error_nr"+solarion+".gif";
    }
    fuction next(){
    solarion+=1;
    document['goljat'].src="serrors/error_nr"+solarion+".gif";
    }
    </script>
    </head>
    <body onload=loaded()>
    <img src="serrors/loading.gif" name=goljat onclick=next()>
    </body>
    </html>
    Have any ideas?

  2. #2
    SitePoint Addict
    Join Date
    May 2004
    Location
    Europe
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    'solarion' is a local variable of the loaded function, it can't be accessed from the next function. Place the 'var solarion=1' line outside the function.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •