Menu
Hey guys
Why shouldn’t the following work? Seems to be the correct syntax. Opera issue?
[CODE]var foo = {};
with (foo) {
bar1 = “orange”;
bar2 = “apple”;
}
alert(foo.bar1); //alerts undefined
p.s. yeah I know with(object) is frowned upon, but it’s useful in migrating your functions to OOP Javascript.
Thanks in advance