Assume that we have a feature / module, which increases a website so it is not really necessary and it I use the requestAnimationFrame , which is like IE8 / 9, I could have polyphil requestAnimationFrame , but because it is only an increase, the old browser should ignore it. The code of this module looks more or less like this: ; {Function (window, document, undefined) {'strict use'; // example module // constructor function module, option) {// ...} Module.prototype = {init: function () {// if requestAnimationFrame Not supported, a warning warning ("init") should be popped up;}, method: function () {/ if the request animationfreck is not supported, then alert any warning ("Start");}}; Window.Module = Module;} (window, document) should pop up; Then I can create a new example var example = new module (document.getElementById ('test')); and "interact with" instance.init (); Instance.method (); The problem with this code ...
Comments
Post a Comment