Equivalent:
$('button').bind('click', fn); $('button').on('click', fn);
Equivalent:
$('button').live('click', fn); $(document.body).on('click', 'button', fn);
Equivalent:
$('button').bind('click', fn); $('button').on('click', fn);
Equivalent:
$('button').live('click', fn); $(document.body).on('click', 'button', fn);
This is how to utilise the Facebook JavaScript SDK to add Share, Like and Comment for your site:
If you see this:
The order of the events triggered will be in the order they’re added. So when the order of two events makes a difference, and they’re in separate files, pay extra attention to which one gets load first. Especially when the page loads extra slow.
It seems like:
*.wav
, but it’s fine with *.mp3
mp3
/ogg
format, but is okay with wav
.In normal cases, go for keyup
:
$(document).keyup(function(e){
console.log(e.which);
});
Reasons:
keydown
keeps firing when user holds the keys down, while keypress
and keyup
fire only once.keypress
doesn’t detect special keys (e.g. SHIFT
), keydown
and keyup
do.I spent 1.5 hours deleting code and comparing and found that JavaScript initiated events just can’t get the video going. One all-mighty Googling [1][2] revealed that, “embedded media cannot be played automatically in Safari on iOS – the user always initiates playback.” Damn.
It looks like a dead end. But wait. How did videojs-youtube managed it?