Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > help with an error - very short code

Reply
Thread Tools

help with an error - very short code

 
 
janice
Guest
Posts: n/a
 
      09-17-2004
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.
 
Reply With Quote
 
 
 
 
Philip Ronan
Guest
Posts: n/a
 
      09-17-2004
Try document.images["whichpic"].src

--
Philip Ronan
http://www.velocityreviews.com/forums/(E-Mail Removed)
(Please remove the "z"s if replying by email)


 
Reply With Quote
 
 
 
 
Philip Ronan
Guest
Posts: n/a
 
      09-17-2004
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
(E-Mail Removed)
(Please remove the "z"s if replying by email)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help running a very very very simple code olivier.melcher Java 8 05-12-2008 07:51 PM
very very very long integer shanx__=|;- C Programming 19 10-19-2004 03:55 PM
very very very long integer Abhishek Jha C Programming 4 10-17-2004 08:19 AM
Quick Book file access very very very slow Thomas Reed Computer Support 7 04-09-2004 08:09 PM
very Very VERY dumb Question About The new Set( ) 's Raymond Arthur St. Marie II of III Python 4 07-27-2003 12:09 AM



Advertisments