L
Lae.
I can't figure this one out. n00b question no doubt, this is my first
ever JS attempt.
Here's the snippet, and here's the full deal
http://www.ualberta.ca/~koryb/first.js
http://www.ualberta.ca/~koryb/
http://www.ualberta.ca/~koryb/test.html runs it
// Runs timer loop and increments pics
function timer()
{ this.incrementSrc()
this.timerControl = setTimeout("timer()", this.counterTime)
}
// Increments the pic number, updates pic src and diplays update
function incrementSrc()
{ var aNumber = this.picNumber
aNumber++
alert(aNumber)
if (aNumber > numberOfPics)
{ aNumber = 1
}
this.newPicNumber(aNumber)
this.newSrcName(sourceGenerator(this.picNumber))
document.getElementById(this.id).src = this.srcName
}
This runs the first loop ok, but the 2nd loop I get a no properties
error for
document.getElementById(this.id).src = this.srcName Actully the whole
object isn't being reffered to anymore it seems. Why?
I can't figure this out.
Thanks for your time,
Lae.
ever JS attempt.
Here's the snippet, and here's the full deal
http://www.ualberta.ca/~koryb/first.js
http://www.ualberta.ca/~koryb/
http://www.ualberta.ca/~koryb/test.html runs it
// Runs timer loop and increments pics
function timer()
{ this.incrementSrc()
this.timerControl = setTimeout("timer()", this.counterTime)
}
// Increments the pic number, updates pic src and diplays update
function incrementSrc()
{ var aNumber = this.picNumber
aNumber++
alert(aNumber)
if (aNumber > numberOfPics)
{ aNumber = 1
}
this.newPicNumber(aNumber)
this.newSrcName(sourceGenerator(this.picNumber))
document.getElementById(this.id).src = this.srcName
}
This runs the first loop ok, but the 2nd loop I get a no properties
error for
document.getElementById(this.id).src = this.srcName Actully the whole
object isn't being reffered to anymore it seems. Why?
I can't figure this out.
Thanks for your time,
Lae.