Jump to content

Objected Expected?


Recommended Posts

Hey all. Can anybody see any errors in this script?

<script type="text/javascript">function loadGallery(totalimages) {	var galleryimage = new Array;  galleryimage[1] = "images/gallery/image1.gif";  galleryimage[2] = "images/gallery/image2.gif";  galleryimage[3] = "images/gallery/image3.gif";  galleryimage[4] = "images/gallery/image4.gif";  galleryimage[5] = "images/gallery/image5.gif";	var imagecaption = new Array;  imagecaption[1] = "camera man - say cheese!";  imagecaption[2] = "cartoon models";  imagecaption[3] = "1337 Crew Pose!";  imagecaption[4] = "noob box";  imagecaption[5] = "maoam and his cars!";	var imageload = new Array;	var x = "1";	while(x<=totalimages) {  imageload[x] = new Image; 	 imageload[x].src = galleryimage[x];  x++;	}	var x = "1";	document.display1.src = galleryimage[1];	document.display2.src = galleryimage[2];	document.display3.src = galleryimage[3];	document.display4.src = galleryimage[4];	caption.innerHTML = imagecaption[1];}	</script>

When i try to run it, im being told an object is expected where i have:

<body onLoad="javascript:loadGallery('5');">

anybody able to help? - Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...