Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 03:54 am EST

Geeklog Forums

javascript error


Status: offline

dotist

Forum User
Newbie
Registered: 04/04/04
Posts: 13
hi

i have a problem w/ some rollover images. on newer browsers the rollover still works, on older stuff the rollovers don't work at all. the error is w/ a script that looks like this:

function changeImages() { if (document.images) { for (var i=0; i
document[arguments[i]].src = eval(arguments[i+1] + ".src");
} } }

and throws this error:

Error: document[changeImages.arguments[i]] has no properties
Source File: http://dyss.net/
Line: 26

this probably isn't GL specific, but if anyone has any ideas, i'd appreciate it.

regards, isaac
dyss.net
 Quote

anonomousOrHowEvrUspellThat

Anonymous
I first changed up your coding format and found a few probs, I think you are aiming for more something along these lines:

function changeImages()
{
if(document.images)
{
for (i=0; i {
document[arguments[i]].src = arguments[i+1];
} //end for
} //end if
} //end changeImages

I am making a couple assumptions of course, like you are passing in 2 arguments for every rollOver, what pic to change and the source url for the new pic as strings. If I am wrong please let me know here. and show me a bit more of your code with comments and I will be glad to retry
 Quote

anoneemouseOrHowEvrUspellIt

Anonymous
Quote by anonomousOrHowEvrUspellThat: I first changed up your coding format and found a few probs, I think you are aiming for more something along these lines:

function changeImages()
{
if(document.images)
{
for (i=0; i
{
document[arguments[i]].src = arguments[i+1];
} //end for
} //end if
} //end changeImages

I am making a couple assumptions of course, like you are passing in 2 arguments for every rollOver, what pic to change and the source url for the new pic as strings. If I am wrong please let me know here. and show me a bit more of your code with comments and I will be glad to retry
There are 10 type of people, those who understand binary and those who don't
 Quote

All times are EST. The time is now 03:54 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content