Posts

Showing posts with the label const

[IE8] Global constants via defineProperty ... Illusion!

I do not want to spend a single word about Internet Explorer 8 Object.defineProperty implementation, which works only with DOM prototypes and the super global window but not with user defined objects , as __defineGetter__ and __defineSetter__ do since ages : Standards are an important factor to ensure browser interoperability for the Web developer (n.d. oh, really?!??!?!!!!) . The accessor property syntax has only recently begun standardization (you guys have a weird concept of the time ... or the meaning of "recent" in IT therms ...) . As such, many browsers support an older, legacy syntax ... (n.d. which at least has dignity to work with every kind of object ... ) Anyway, few things are better than nothing, so welcome to Object.defineProperty! Let IE8 behaves like every other or change every other to respect new M$ standard? This was the first question when I thought about this new global function: does it mean we finally have a way to emulate __defineGetter__ and setter in...

SCARY EVAL ... and the "futuristic" solution

Image
Planet Earth, Year 2000 eval("document." + myformName + "." + myInputName + ".value"); Satellite Moon, Year 2004 eval is evil, nobody should use them, " except for json evaluation " Planet Earth 2.0, Year 2008 OMG somebody could penetrate my closures!!! Web Reflection, few days later First of all, it was in the MDC , so if everbody is surprised, it is because we did not read that page, or simply we did not try that code (please correct that page, the second argument is everything but not the same of with statement). Secondly, please, DO NOT CHANGE THAT FEATURE !!! What I mean is that JavaScript is an amazing language, where everything could be changed , thanks to its intrinsically dynamic nature. If we are worried about this fake news: we should worry, before, about XSS in our site (after SQL injections) if we are sure about missed XSS possibility, we should be worried about external libraries if we are sure about third parts libraries, we shoul...