Tuesday, August 24, 2010

Waiting for things in javascript

Problem:
Sometimes i need to wait for something to come into existence in javascript, and then do something with it. This is usually because another frame (shudder) is still loading and i need something in it. Also it helps with IE bugs where something should be there, but isn't because IE is taking a stupid long time to load it.

Solution:

Use this utility function to create a check/act loop.