🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #1117

JavaScript : Variables in Coding ?

#1117
From: Adam Arnel
Date: Sun, 01 Aug 1999 00:00
16 lines
1600 bytes
When writing with JavaScript, I am using a varaible ( tempvar ), and am
making a string from it using another numerical variable ( number ) to
make a piece of coding which I wish to use in the javascript code
( tempvar = "document.img" +number +".src=picture.gif" )

so that the value of 'temp var' will be in the form of
"document.img1.src=picture.gif" , or whatever the value of 'number' is at
the time... I then wish to use this string in the code, how can i do this ?

I have tried "document.write(tempvar)" and "return(tempvar)" and just simply
"tempvar", but they just write the string to the page, instead of sticking
the string in the coding to act as code and be manipulated.....I would be
appreciative if anyone could help me with this, if so, please send any
suggestions or tips to adam@ballarat.starway.net.au .... thanks

adam arnel
Technical Details
Message-ID: <933511641.954306@diddley.primus.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,f21f84642ad8824f
X-Google-Attributes: gid10d6db,public
From: "Adam Arnel" <adam@ballarat.starway.net.au>
Subject: JavaScript : Variables in Coding ?
Date: 1999/08/01
Message-ID: <933511641.954306@diddley.primus.com.au>
X-Deja-AN: 507590992
Cache-Post-Path: diddley.primus.com.au!unknown@ras9.ports.bal.primus.com.au
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Complaints-To: abuse@telstra.net
X-Trace: nsw.nnrp.telstra.net 933511637 203.134.0.92 (Sun, 01 Aug 1999 22:47:17 EST)
Organization: Internet Primus
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
NNTP-Posting-Date: Sun, 01 Aug 1999 22:47:17 EST
Newsgroups: aus.computers.java