Posts

Showing posts with the label setter

Rewind: getters & setters for all IE with cross browser VBClass!

spoiler: if once again everybody knew except me, you guys should do something to be better indexed in Google ... while if this is totally new and cool, well, you are welcome :) Sometimes I am stubborn, so stubborn, that even if it was me writing this post , and this one after , I have never given up about IE < 9 getters and setters ... " there must be a way ", I have thought during last days, and ... yes, eventually I have found the way ! Test Driven Developed Solution I have decided the possible behaviour, I have implemented all use cases, and I have successfully validated them against all browsers I could came up, with the exception of a single test, the first one, which fails in those browsers unable to freeze an object ... well, these browsers are disappearing thanks to their suggested, or automatic, updates, so everything is fine. Here the unit test that should cover 100% of the used JavaScript and/or the used VBScript where available (only IE < 9 so please don...

...btw, getters & setters for IE 6, 7, and 8 (almost!) : Object.createStatic

Image
Update Yes, I did it: getters and setters for IE < 9 and other browsers Update apparently Dojo framework explored this stuff before me Re-Update: More limitations!!! Apparently I have said "Hooray!" too early, @_bga told me that this way is compatible with primitives only since the moment we have a property with an object or a function, this will converted into string. So: don't return objects or functions since these will not work as expected! Well, still something tho ... I should probably change the title with a big "almost" ... ... pretty much, the " dream comes true " features that could open hundreds of doors for current Web development status is here, but before we can understand properly the example page , we surely need a bit of introduction about the topic ... Getters/Setters For Everybody! Getters and Setters are beautiful, powerful, and the ideal scenario for whatever developer behind any sort of API. Getters and Setters work perfect...