By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

help with an error - very short code

P: n/a
Hi all,

Can someone tell me why this won't work? (I get a
"document.images.whichpic is null or not an object" message.)

-----

var numbeads = 0;

function addABead(whichbead, w, h) {

var whichpic = "pic" + numbeads;

document.images.whichpic.src = whichbead;
document.images.whichpic.width = w;
document.images.whichpic.height = h;

numbeads += 1;

}

-----

Thank you in advance for your help!

J.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try document.images["whichpic"].src

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #2

P: n/a
On 17/9/04 2:46 pm, Philip Ronan wrote:
Try document.images["whichpic"].src


Oops, lose the quotes. Sorry

document.images[whichpic].src

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.