whats problem in this code ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

whats problem in this code ?

Post by PHPycho »

Hello forums!!
I am using this code for preloading images

Code: Select all

var images = new Array();
var i = 0;
images[0] = "img/image1.gif";
:
:
images[4] = "img/image5.gif";
//alert(images.length);
// start preloading..
for(i = 0; i < images.length; i++){
var imageObj[i] = new Image();
imageObj[i].src = images[i];
}
and following error occurs (in firebug)
missing ; before statement
[Break on this error] var imageObj = new Image(); \n

Any Idea where i went wrong ..
thanks in advance to all of you
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Descriptive Subjects

Post by feyd »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
imageObj isn't an array.
Post Reply