Cache regexes in javascript
This post about precompiling and caching regular expressions came across my Google reader just as I was wrangling with a slow regex issue. Not sure my issue will benefit from this, but neat regardless.
This post about precompiling and caching regular expressions came across my Google reader just as I was wrangling with a slow regex issue. Not sure my issue will benefit from this, but neat regardless.
I recently had to come up with a regular expression that I could run against an HTML string that would only affect content, not tags or attribute values. I’m no regex master, so after a whole lot of failed attempts, I turned to the Google and found this invaluable regex tester, which also had a […]
I just got a request to edit a static page that showed several of a company’s employees. Turns out that a bunch of them aren’t employees anymore, and the client wanted the page to be updated. I knew before I even opened it that the content was going to be in tables (nested nested tables, […]
I used to work in newspapers, and we were diligent about fixing “bad breaks” in headlines. Nothing looks worse than a headline that’s far longer on one line than on another. Desktop publishing software has some intelligence about these bad breaks, but the web, not so much. A little jQuery can clean up the bad […]
It was just a couple of months ago that I was naively lobbying my friends to join Facebook. I envisioned creating a place where I could find out what everyone — especially people who were more acquaintances than friends — was doing, without the burden of keeping in contact with them individually. Joe was going […]
Go get it — just for the DOM color analysis, if nothing else. If only it were integrated with Firebug, it would be perfect.
Note to self: IE6 likes to cache AJAX requests, and this can be a bad thing if other data on the page that will affect the result of the request has changed.
You’ll see this if you have two fields on a page that both contribute to a result, but only send them to the […]
I’ve written several versions of this functionality, and each time I revisit it, it gets simpler and I feel silly for how complicated I made it before. The thing to remember when you’re working with jQuery is to always leverage the DOM. Christian Montoya has a good writeup about how he came to the same […]
I’ve drummed up a lot of visitors by posting links on dzone and StumbleUpon, but the visitors aren’t very sticky — many will visit the single page I linked to and then move on.
Looking at my site exits in Google Analytics, I noticed that my category pages had much lower exit rates than my […]
Sometimes, you may want to know what outbound links a user is clicking on — say, if you’re linking to an affiliate’s site and want to be able to count the clicks you’re sending. Google Analytics offers this bit of code to accomplish this:
<a href="http://www.example.com"
onClick="javascript: pageTracker._trackPageview(’/outgoing/example.com’);">
and says:
Google Analytics provides an easy way to track clicks […]