[thelist] testing for empty in javascript or vbscript

Tom Dell'Aringa pixelmech at yahoo.com
Mon Jul 15 19:18:13 CDT 2002


Actually, no - this should work, thanks to JS loose types. Do this in
a blank document.

<script>
i = 2
zip = "zip" + i;
document.write(zip)
</script>

change i to whatever you want. You will get zip2 or whatever number
you input.

Tom
--- Shashank Tripathi <sub at shanx.com> wrote:
> Hi,
>
>
>     | >       zip = "zip" + i;
>     |
>     | on this line you are making the variable called 'zip'
>     | hold the string "zip" + i. which, depending what value
>     | 'i' has, would be something like "zip1" or "zip2". which
>
>
> No, this would not make the variable zip1 or zip2. It will add the
> value
> of "i" to the value of zip. In order to get zip1 or zip2, you would
> have
> to use eval() function. e.g.,
>
>     eval("zip" + i);
>
>
> It would be useful to know again what the original question was?
> Sorry I
> missed the thread.
>
> Shanx
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the thelist mailing list