Dave Rolsky wrote:
Maybe you tried to access a DOM element before it was available, which is why the delay fixed the problem. You might find the JSAN library DOM.Ready useful (disclaimer, I wrote it): http://www.openjsan.org/doc/a/au/autarch/DOM/Ready/0.13/index.html
Thanks! -Jürgen