Monday, July 27, 2009

facebook's box alike

After quite long doing research on how to display a popup like what is in facebook, I found a way to do so. It is a jquery plugin which name is facebox (you can google this). Basically, the basic functionalities of this plugin is poping up a window which contains an information from certain dom. Start from this understanding, it can be improved to insert an information from another page (using xhr). Of course, when i say using xhr, it can only fetching data from the same domain as xhr cannot be used to fetch data from different domain.

Well, in this blog, i would like to share the way it works in a bit high level for the operation of fetching data from another page. Basically, this plugin only fetch the data from another page and insert it in a dom. Of course, it will be hidden. After fetching the data, there will be a decorator manipulation which is the popup window itself and grab the information from the dom and put it in the popup window. Well, that's all. Its simple, isnt it? Of course, for my need, I tweak it a bit.

Below is the picture of my try where the information is grabbed from Twitter.