Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var support = {
- animationFrame: window.requestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- window.oRequestAnimationFrame
- };
- support.animationFrame(function() {}); //error
- support.animationFrame.call(window, function() {}); //right
- var myObj = {
- myAlert : alert //copying native alert to an object
- };
- myObj.myAlert('this is an alert'); //is illegal
- myObj.myAlert.call(window, 'this is an alert'); // executing in context of window
- var obj = {
- alert: alert.bind(window)
- };
- obj.alert('IĀ“m an alert!!');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement