How are the facebook chat windows implemented? - facebook

On Facebook you can browse the site without affecting the floating chat windows. Seems like if the main page was inside an iFrame and the footer and chat windows where floating outside.
(source: k-director.com)
Is the main content inside an iframe or are the footer and chat windows the ones inside an iframe?
The later doesn't seem possible because int this case when you click in a link in the main page everything would have to reload, including the footer iframe.
If you refresh the page the chat windows are reloaded, but if you browse the site by clicking links they are not.
Thank you.

If you install FireBug and enable the net monitor for Facebook, you'll see that when you click most links inside the application, you're not doing a full page refresh, but rather an AJAX call which updates the page with the new content.
It looks like a new page, but in reality you're on the same page with just about everything but the chat-bar replaced.

Probobly just an absolutely positioned div, containing a scrolling div for the content. Ajax would provide the content.

The chat windows do indeed refresh when you load a new page, they maintain their viewstate however (open/close/chat history).

It's an absolutely positioned div, positioned at the bottom of your browser window. It's not hard, I cloned the Facebook chat for ClockingIT from scratch in a weekend.

Related

How can i insert iframe in footer Layout Zend without refresh this footer?

I am building an application using Zend Framework and i need insert one iframe in footer this application but, when i press F5 or click link or button, all page refresh even iframe.
The layout zend is called everytime when i dispatcher an event to server, ready, the iframe too. (My iframe is in the foorter.phtml, ready, it called together layout).
Someone have an some idea how to resolve this question?
tks
You cannot refresh the whole page except for an iframe on the page. When you ask a browser to refresh a page, it will refresh the whole page, there's no way to do it any differently.
To do what you seem to want to do, without using Javascript/AJAX, you'd have to use two frames. One for the top part of your website, and one for your footer. Here is an introduction to frames and how they work (iframes are similar, they are just "internal frames"): http://www.w3.org/TR/html4/present/frames.html
Please, however, note that using frames/iframes is not a practice I personally encourage. You should ask yourself why you are trying to do this. If it's to reload only a certain part of the page, then you should probably check into Javascript/AJAX alternatives.
If you want to disable the layout for some action you can use $this->_helper->layout ()->disableLayout ();. Put it in the iframe action, which will disable the layout and will show only the view of the action.

How did Facebook implement the chat sidebar?

I'm trying to understand how Facebook implements the chat sidebar. It seems to stay there even as I change pages. For example, if I select some text inside the sidebar, then click to go to another Facebook page, the text remains selected. It's as if it was a separate frame, but when I look at the code, it's not.
All requests are made trough AJAX calls. Only "content" container is replaced when needed.
You don't actually "go" to another page. Just the "content" div gets updated.
There is a container DOM element called "fb_content", its content is replaced through straight-forward AJAX or more technically XMLHttpRequest. (Although when for example you enter an app, the entire page is refreshed.) To update the address bar they use the JavaScript History API.
In addition to what Zeno and lericson said (fb_content gets updated via ajax), the address bar also gets updated while maintaining the history (if you press back/forward).

facebook-app: share-button and iFrame resize code together

Is it possible to have a share button (the old one) and the iFrame resize function in the same app? It seems the two javascript libraries don't work together.
Update
I finally replaced the old share button with a FB.ui feed dialog:
https://developers.facebook.com/docs/reference/dialogs/feed/
you could nest the share button in a separate iframe, so the library won't need to work together

JQTouch animation flicker

I have been working a JQTouch app. The functionalitly is correct however my animations on some menu items flicker, especially when you click a back link. The strange thing is it is only on certain menu items.
All pages are loaded in the same way via AJAX.
Can anyone shed any light on this?
site can be viewed at:
http://www.alliancerail.co.uk/ip/iphone.html
Thanks
Chris
I think you have an extra closing </div> that appears after "about" and right before "gnwr." Not sure if this will end up fixing your flicker problem...
You are loading content dynamically. Sometimes the jqt animates to the new page before that page has content. Try including more content in index.html such as the about or contact pages. You can also write your own ajax routines that get fired from onClick events bound to the anchor tag on your home page.
The goog group is a great resource -> https://groups.google.com/forum/#!forum/jqtouch

Facebook Fan Gate Page with jquery overlay

I'm basically creating a 520px wide welcome page for Facebook which I will upload onto the server and then Iframe it into a Facebook fan page. I'm doing this using HTML, CSS and JQuery rather than the old FBML method.
I've seen a lot of companies using an overlayed image to tease the user to 'like' the page. Once the user have liked the page, the content underneath is visible.
Examples:
https://www.facebook.com/redbull
https://www.facebook.com/smirnoffus
Red Bull - when the like button is triggered the transparent image is hidden to show content underneath
Smirnoff uses an image to give the illusion that the image is overlayed on top of the content. Somehow when the like button is triggered, the image is swapped for content.
Can anyone shed any light on how this can be acheived? I don't mind which one - Smirnoffus looks easier but might be a pain as everytime I update the content, I'll need to update image too.
When a user likes your Facebook fan page, Facebook will reload the whole page. You can then use server code to inspect the signed_request post parameter that they will send over. This question has an example code of how to detect if they liked the page in server side code.