I recently had a developer on my team who had some trouble with jQuery’s $(…).data() syntax. In case anyone else has trouble, maybe I can clarify things a bit. I’m anonymizing all the code involved, of course. We wanted to make certain items have certain behaviors under certain circumstances. And so we set up a “whatToDo” […]
Tag Archives: JavaScript
Skipping Regexes in ES6 is Nothing Compared to Skipping Boolean-Comparison Warts
Yesterday, Wes Bos tweeted about ES6’s startsWith(), endsWith(), and includes() methods. He said it was “[t]hree less JavaScript Regexes you’ll have to write”. Which is true, but I feel it misses the point. I mean, the regexes for initial match and final match are really not that hard, and the regex for plain inclusion is, well, […]
Can jQuery Put Pressure On WebKit to Fix Bugs?
If you didn’t already know that Opera Software decided to toss its Presto rendering engine in favor of WebKit, just stop reading this post right now and go catch up on the past week of news in the world of web development and browsers. Don’t worry, I’ll wait. Assuming you did already know that, you should […]
Silly Coding Tricks: “Inverted” String Match
First things first: Never actually do this. This is just a fun curiosity, for amusement value only. Because of the way JavaScript’s search() method works, you can do: var my_url = 'http://kai.mactane.org'; if (! my_url.search(/http:\/\/kai.mactane.org/)) { alert("Your URL is http://kai.mactane.org"); } else { alert("Nope, your URL isn't http://kai.mactane.org"); } Try running this, and it will […]