Advertisement
Guest User

Untitled

a guest
May 4th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. var support = {
  2. animationFrame: window.requestAnimationFrame ||
  3. window.mozRequestAnimationFrame ||
  4. window.webkitRequestAnimationFrame ||
  5. window.msRequestAnimationFrame ||
  6. window.oRequestAnimationFrame
  7. };
  8.  
  9. support.animationFrame(function() {}); //error
  10.  
  11. support.animationFrame.call(window, function() {}); //right
  12.  
  13. var myObj = {
  14. myAlert : alert //copying native alert to an object
  15. };
  16.  
  17. myObj.myAlert('this is an alert'); //is illegal
  18. myObj.myAlert.call(window, 'this is an alert'); // executing in context of window
  19.  
  20. var obj = {
  21. alert: alert.bind(window)
  22. };
  23. obj.alert('IĀ“m an alert!!');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement