Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Creating a DOM based Image Rotator
- From: wdlists at triche-osborne.com (Triche Osborne)
- Subject: [Javascript] Creating a DOM based Image Rotator
- Date: Fri Aug 19 08:18:01 2005
Just an afterthought note on this:
> function rotate()
> {
> if (curDocImg.complete)
> {
. . .
> }
> }
>
If window.onload has not fired yet, curDocImg will have no properties.
While this prevents the script from executing, it will throw a
non-material error. A cleaner approach would be to change the if() test
into something more suitable such as:
if(curDocImg)
or
if(curDocImg != null)
This has the same material effect has the original, but doesn't throw an
error if window.onload hasn't fired.
Triche
- References:
- [Javascript] Creating a DOM based Image Rotator
- From: Harvey A. Ramer
- [Javascript] Creating a DOM based Image Rotator
- From: Triche Osborne
- [Javascript] Creating a DOM based Image Rotator
- Prev by Date: [Javascript] how to get values from database using javascript
- Next by Date: [Javascript] Encoding Unicode characters in HTML
- Previous by thread: [Javascript] Creating a DOM based Image Rotator
- Next by thread: [Javascript] Encoding Unicode characters in HTML
- Index(es):