Rob Larsen

Archive for the 'javascript' Category

PSST! I've Got a Presentation Next Week – JavaScript Library Comparisons

I am cranking through some code examples and plenty of research for this thing. It should kick incredible amounts of JavaScript ass. Come to think of it, it's a ninety minute presentation, so it better kick ass :) I'm going to look at load times, execution times, ySlow scores, codebase and add pure editorial commentary for several popular libraries (at minimum, jQuery, YUI, Prototype, and Dojo), as well as pure JavaScript and my own bare-bones library.

If you're a Boston JavaScript nerd, I hope to see you there.

Here's the description:

Our next JavaScript Meetup will be held on Thursday, April 30th at Microsoft Research Center located at One Memorial Drive in Cambridge. You should come to the 11th floor to be let in. There is also parking available at a cheap evening rate in the building.

Rob Larsen , Principal Presentation Engineer at Cramer, will demonstrate comparisons between raw JavaScript and utilizing the more popular JavaScript libraries currently available.

After the presentation | demonstration, we will go around the room introducing ourselves and asking the group for advice | opinions on any JavaScript-related issues members are facing.

Microsoft will provide pizza again. What a nice company!

Please RSVP and bring guests. We always have lots of pizza left over.

And the meetup.com link:

April Boston JavaScript Meetup Meeting – JavaScript Library Comparisons – The Boston JavaScript Meetup Group Cambridge, MA – Meetup.com

A JavaScript Curiosity Regarding addEventListener

I'm wondering why this code fails to stop a form submission

document.forms[0].addEventListener("submit",falsify, false);

function falsify() {
		return false;
}

and this code successfully kills it?

document.forms[1].onsubmit = falsify;

function falsify() {
		return false;
}

Try it out (Firefox/Safari/Chrome/Opera only- there's no addEventListener support in Internet Explorer). The form action on both is an alert. The first executes every time. The second never does.

Anyone out there know enough about the inner workings on addEventListener to explain why those two similar code blocks behave so differently? I've poked around a lot of the usual suspects (mdc, ppk, w3c) and haven't seen anything that speaks to the above behavior, so I'm opening it up to the Internet. Hopefully someone out there can satisfy my curiosity on this matter.

Looks Like I Might Be Doing a Presentation Next Month

The topic will be a hands on comparison JavaScript libraries. I'm going to write the same functionality (probably a Twitter search) in plain JavaScript and several popular libraries. I'll discuss the anecdotal findings of using all the different libraries for the task and I'll also offer up numerical analysis of the different pages- execution time, page load time, etc.

More info as I get it. Should be fun if it happens. It'll be a little bit of work as I'll have to prep for it, the work itself looks like it will be a lot of fun.

Good times.

Twitter Search Results With JSON and Callbacks

A question was posed in the comments on my JSON Feeds For Fun and Profit Part 2 – Callbacks with Twitter post about handling Twitter search results for a #hashtag. As with the rest of Twitter's API, dealing with search results is relatively straightforward. This post will examine how to handle a #hashtag search.

If you're not familiar with JSON or callbacks you might want to read the above referenced post to get up to speed.

Otherwise… it's on.
(more…)

A Couple of Links and Random Thoughts, Dropped on You Out of the Blue

I haven't shared random bits of Internet with you for months. That changes right now.

(more…)