Skip to content

24 ways to impress your friends

Vote up?

Patrick

You can avoid the extra function definition (which, besides looking clumsy, puts an unnecessary variable in your global namespace) to attach the call to striper() to the onload event, you can use an anonymous function like so:

window.onload = function() {

striper('tbody','splintered','tr','odd,even');

}

Also, if you have existing onload events, you can check out Simon Willison’s tutorial on how to avoid overwriting them: