Thursday, 5. October 2006, 21:35:16
coding, quiz, ecmascript, javascript
The other day I ran into weird errors while editing the Y!Mail patch in browser.js. The whole thing stopped working, and it took me a while to see the problem. Can you see it?
// need to fake someMethod
Element.prototype.someMethod=function(){
// faking someMethod here
}
// we also have an insertBefore problem so let's fix that too
(function(oF){
// tweaking insertBefore here
})(Element.prototype.insertBefore);
What was wrong? Hats off if you can see it without running the code..
Monday, 18. September 2006, 13:36:27
quiz, regexp, ecmascript, coding
...
This snippet is brought to you by
Yahoo!Japan blogs. Quiz of the day: what is the RegExp meant to do and why does it fail?
if(img.match(/(.[jJ][pP][eE]?[gG]|.[gG][iI][fF]|.[pP][nN][gG])/)) {
return true;
}
return false;
(Yes, the variable name is a hint.)