Skip to content

Instantly share code, notes, and snippets.

View hugojay's full-sized avatar
🇹🇼
Don't Forget 64 in China

宇狗 Hugo hugojay

🇹🇼
Don't Forget 64 in China
View GitHub Profile
@jiggliemon
jiggliemon / FBready.js
Created August 16, 2011 02:34
A Better way to handle window.fbAsyncInit
/*
Requires:
- Events: https://gist.github.com/884484
- Extend: https://gist.github.com/1049896
- Namespace: https://gist.github.com/1006005
*/
SML = Object.namespace('SML',new Events);
window.fbAsyncInit = function(){
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);