Wednesday, May 13, 2009

Too much javascript

You know you've been doing way too much javascript when you catch yourself doing crap like this:



html += '<a id="linkToFoo">...</a>';

...

$('#divToAugment').append(html);

...

$('#linkToFoo').click(function() {
window.location = '/foo/bar.html';
});



Hint: If all you want to do is make an 'a' tag clickable and have it take you to another URL, there's a much easier way...

No comments: