Two JavaScript Points
-
- Hereabouts I once said that
window.eventis the same aseventin a browser, becausewindowis the global object. That was almost right.
This will get a cross-browser event:
onSomeEvent( e ) { e = e || event;MSIE, and I don't have it pinned down yet, sometimes insists on the
window.prefix. I've started to routinely includewindow.even though it looks pretty dumb.- Pop Quiz!
var arr = [1,2,3,4,5]; for ( elem in arr ) { alert(elem); }What is the first
elem?Dan, if you know the answer, please be a little slow to post it.
- Hereabouts I once said that
-
@martinrinehart said:
Dan, if you know the answer, please be a little slow to post it.
.. yuz callin' me Slow, cuz'n ??

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement