Something like :
--
function foo(x)
{
window[x] = 1;
}
foo('bar');
alert(window.bar);
On 15 nov, 19:24, Johnnie Walker [EMAIL PROTECTED] wrote:
Hi,
Is there any way to add a property named via a variable to a
javascript object?
Something like this would work:
foo(bar);
function foo(prop) {
window[prop] = 1;
}
Ted
On Sat, Nov 15, 2008 at 1:24 PM, Johnnie Walker [EMAIL PROTECTED] wrote:
Hi,
Is there any way to add a property named via a variable to a
javascript object?
this is what I would like to do:
2 matches
Mail list logo