Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] dynamic variables names
- From: christ at saeweb.com (Chris Tifer)
- Subject: [Javascript] dynamic variables names
- Date: Tue Jun 24 11:10:58 2003
Do you have a dynamic variable name? I would never use a dynamic variable to be honest with you - or at least haven't ever found the need for one yet, but from the looks of it below, you don't have a dynamic variable, but rather you're trying to build a reference to an image dynamically. To do that, use the document.images collection and build your string when targeting a specific element in that collection: document.images["nt_o" + i].src = "path/to/image.gif" That's not a dynamic variable name - just so you're aware. Chris Tifer http://emailajoke.com ----- Original Message ----- From: Marcelo Simon To: * Yahoo / Javascript Sent: Tuesday, June 24, 2003 11:50 AM Subject: [Javascript] dynamic variables names Hi list, It's me again, and I need some help again please. how can I use dynamic variables name in JS ? I mean, how do I evaluate the 2 parts so they work ? if ( i <= number ){ ['nt_o'+i].src = '../_img/1_nota_0'+i+'_on.gif'; } thanks in advance ------------------------------------------------------------------------------ _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20030624/5452f1f7/attachment-0001.html
- Follow-Ups:
- [Javascript] dynamic variables names
- From: Marcelo Simon
- [Javascript] dynamic variables names
- References:
- [Javascript] dynamic variables names
- From: Marcelo Simon
- [Javascript] dynamic variables names
- Prev by Date: [Javascript] dynamic variables names
- Next by Date: [Javascript] dynamic variables names
- Previous by thread: [Javascript] dynamic variables names
- Next by thread: [Javascript] dynamic variables names
- Index(es):