Ben Nadel declared June 1, 2008 the first National Regular Expression Day, and to celebrate he hosted a giveaway of regex-related prizes, including Jeffrey Friedl’s Mastering Regular Expressions. As you can see, I won the book and got it in the mail yesterday. I use regular expressions all the time—in PHP, JavaScript, Perl, sed, grep, […]
Tag Archives: JavaScript
A Good Enough addEvent
April 14, 2008 – 11:48 pm
Several years ago, PPK of Quirksmode sponsored a contest to come up with a new version of the trusty JavaScript addEvent function. The original addEvent was created by Scott Andrew LePera in 2001 as a way to merge Internet Explorer’s attachEvent with the W3C’s addEventListener. Both addEventListener and attachEvent allow you to attach a JavaScript […]
JavaScript Email Hiding
June 28, 2005 – 1:08 pm
If you plainly show an email address on a website, it’s likely to be harvested by a spam spider. To get around that problem, I’ve been using the following JavaScript in the middle of a page: <script type="text/javascript"> <!– This script hides the email address from spiders –> […]