Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Can anyone see what´s wrong with this Javascript?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 15 June 2004 :  15:39:37  Show Profile
Get this error:

Line: 20
Char: 3
Error: 'document[...]' is null or not an object
Code: 0

-------------the code--------------line 20 in bold:

<script language="JavaScript">
<!--

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
n_new_o = newImage("../bilder/n_new_o.gif");
n_bio_o = newImage("../bilder/n_bio_o.gif");
n_disc_o = newImage("../bilder/n_disc_o.gif");
n_gal_o = newImage("../bilder/n_gal_o.gif");
n_down_o = newImage("../bilder/n_down_o.gif");
n_press_o = newImage("../bilder/n_press_o.gif");
n_les_o = newImage("../bilder/n_les_o.gif");
n_cont_o = newImage("../bilder/n_cont_o.gif");
n_home_o = newImage("../bilder/n_home_o.gif");
preloadFlag = true;
}
}


// -->
</script>

Edited by - wii on 15 June 2004 15:40:05

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 15 June 2004 :  16:26:16  Show Profile
can document be an array like you have?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 15 June 2004 :  16:31:41  Show Profile
Ehh ?
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 15 June 2004 :  17:19:35  Show Profile
i don't think that document[] is a correct syntax.... shouldn't it be:

document.images[changeImages.arguments[i]].src = changeImages.arguments[i+1];

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 15 June 2004 :  17:52:10  Show Profile
Let´s try it...hang on.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07