Hi,
I'm a beginner to DHTML. I have a javascript function that gets called
a lot from buttons etc within an html file. The first thing this
function does is a "document.getElementsById" call which I'm assuming
could be pretty expensive.
My question is could this information be cached, so the
getElementsById only gets called once? I was thinking of simply using
a global variable initialized to null and assigning it at the first
call, but I dont know if the standard supports this, or if the js
"environment" gets reset at every function call from the body (so that
each call works as if it were the first), or if the standard is
unclear on this, etc.
I'd appreciate any alternative solutions if the above is not going to
work (I'm not looking for hard-disk type storage like cookies, or any
nonstandard solutions: not worth the effort!). Thank you.
Khan