i was trying to bring prototype into a non-prototype page and this error happened:
element is null
on page load.
BUT I DIDN’T DO ANYTHING WITH PROTOTYPE YET!!
How come its not loading?
Well it turns out I’m so in love with prototype that I had already defined:
return document.getElementById( a ) ;
ie 8 passes Acid 2.
Wow! I remember seeing Hakon Wium talk about how badly ie fails in this youtube video (he starts speaking at about the 28 minute mark)
also today: iui lib – apple-iphone like interface – very cool
asserts in C++
And some nerdcore rap that entertains (however briefly), linked to in above article: mcplusplus
If you’re going to hardcode event handlers right into your HTML, (perhaps its being delivered from a php page) there’s 2 ways you can do this:
<span onclick=” runFuncAndTargetIsTHIS( this ); “> <!– way A –>
<span onclick=” runFuncButNeedToExtractTarget( event ); “> <!– way B –>
Function for way A looks like:
runFuncAndTargetIsTHIS( elem )
alert( elem + ' is the HTML element that was clicked' );
While way B:
runFuncButNeedToExtractTarget( e )
e = e || window.event;
var target = e.target || e.srcElement;
alert( target + ' is the HTML element that was clicked' );
Some people say you shouldn’t do things using Way A. But I find Way A sometimes convenient. The only reason I can think of right now that Way A is bad is its easier to cancel propagation (cancel bubbling) of event registered using way B.
this entry explains how to use window.setTimeout( code, delay );
the first argument can be a function object