This is a discussion on "Newbie need help on js" within the JavaScript Forum section. This forum, and the thread "Newbie need help on js are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Newbie need help on js
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Newbie need help on js
i am trying to "rotate" 4 images at set time interval
here's my javascript
can anyone tell me what's wrong? thanks!! Last edited by Rakuli; Nov 30th, 2007 at 12:53. Reason: adding [code][/code] around scripts makes it easier to read |
|
|
|
|||
|
Re: Newbie need help on js
PS i have a question concerning DOM
whats the difference between window.document.getElementById.... and document.getElementById...? thx |
|
||||
|
Re: Newbie need help on js
you have a random semi-colon in the first function of your script that may be cascading to errors further down, fix that first.
Thanks.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Newbie need help on js
In regards to your second question, there is now difference,
document.getElementById is the same as window.getElementById however, you may wish to refer to a specific window and sometimes you can get lost so if you opened a popup named "thisPopup" and want to reference it from the opening window use thisPopup.document.getElementById. Essentially, placing window. in front of the your document calls means that javascript cannot possibly falsely choose the scope as you you are telling it to explicity reference "THIS" window... Hope that makes sense,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Newbie need help on js
Thanks for the quick reply!
i've deleted the lines of if and else in the newpage function yet nothing happens... and no my browser did not give any error message images simply did not change |
|
||||
|
Re: Newbie need help on js
rotateImg;
needs to have parenthesis you tell javascript it is a function call
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hello everyone! Another newbie here. | Joker | Introduce Yourself | 6 | Aug 19th, 2007 20:52 |
| newbie | Janna122003 | Introduce Yourself | 7 | Feb 6th, 2007 17:21 |
| Hi newbie to all! | Brooksy | Introduce Yourself | 3 | Dec 7th, 2006 22:24 |
| Newbie | toefunky | Introduce Yourself | 6 | Nov 19th, 2006 05:54 |
| help with css for a newbie | sing2trees | Web Page Design | 2 | Jan 29th, 2006 16:24 |