开发者

JavaScript Handler Calls - How to Implement this Structure?

开发者 https://www.devze.com 2023-01-08 11:24 出处:网络
Not sure what to call this post exactly.I want to mimic a structure I\'ve seen in Facebook, but I\'m not actually using Facebook, this was a good example. I remember from using the Facebook API that i

Not sure what to call this post exactly. I want to mimic a structure I've seen in Facebook, but I'm not actually using Facebook, this was a good example. I remember from using the Facebook API that it had a method that did:

FB_RequireFeatures(<key>, <handler>)

This method essentially said if the feature was ready to go at the time of the function call, the handl开发者_运维百科er was immediately invoked. If not, it was queued and called when it was available.

I think I understand how to implement something like this on my own, but I wanted to see if anyone else has done this, if you could send me a link, it would be very helpful to see.

I guess I am also implementing something similar to JQuery's ready event; if the event has already past, the handler is immediately fired (I think), but if not, the handler is queued.

Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消