Calculate your site FeedRank Today
FeedRank, a newly developed algorithm for ranking RSS feeds only on RSSMicro
Click here to learn more
 1/10 Low --- www.ts0.com http://feeds.feedburner.com/Ts0
Monday, February 04, 2008 --- 172 days ago http://www.ts0.com/2008/02/dom-ready-now-with-added-curry.asp
| The cross browser DomReady event is a great feature in all the good JavaScript libs. Basically you use it where you'd normally use the window onLoad event, the only difference is that it doesn't wait for images and other large assets to load before firing. So when people are in a hurry or the page is just slow they don't get a lessened experience because your progressive enhancements haven't done their enhancing.
Quite often you don't want to use a library, like when you're trying to make a simple standalone util. So here's a simple standalone cross browser DomReady script , tested in a few versions of IE, FF and Safari (should be fine in Opera).
Here's how to use it in it's simplest form.
WhenDomReady(
function(){
alert('I\'m ready to go!')
}
);
Here's how to use currying, the second argument is the scope that the method is fired in and the rest of the arguments are passed to the method.
WhenDomReady(
fHandler,
MyNamespace,
'init');
So this would call the function fHandler , when that function uses this it will refer to MyNamespace and it's one argument is a string containing init
... |
|
|
Recent Posts
|
|
|
Facebook
Del.icio.us
Digg
StumbleUpon
Reddit
Google