Menu
I have only learned recently that you can use
[color=green]window[“somevarible”+i]
[color=red]eval(“somevarible”+i)
So that works with global varibles — outside of functions.
But how do you “get” a local varible — inside a function?
[code=html]
<script type=”text/javascript”>
onload=function(){
var somevarible1=”hi”
alert(window[“somevarible”+1])
/* Alerts undefined */
}
</script>