If you’re performing a JavaScript animation effect on an element (e.g., jQuery’s fadeIn/fadeOut), you may notice that the text briefly pixelates in IE. You can fix that by setting a background color on the element.
404 After Saving Custom Post Type
There’s an active bug related to custom post types and permalinks in WordPress 3.0.3. Here are the conditions that it exists under: Permalinks include %postname% A custom post type exists with an empty value for the slug key on the rewrite array A post/page/etc has been saved after the custom post type was installed You’ll […]
Sub-pixel letter-spacing in CSS
There’s a thread on the Sitepoint forums about the smallest amount of letter-spacing you can use. Most of the responses are useless, annoying and wrong, but #36 finally gives a good answer. Most browsers only support integer pixel values for letter-spacing. This is a problem because, when it comes to letter-spacing, there’s a big difference between […]
Distributing Fonts Via @font-face
Instead of using images, Flash or JavaScript to replace normal text with non-standard fonts, you can now use CSS’s @font-face rule. It will tell the browser to download the fonts and render the text using them. Internet Explorer uses the EOT format and everyone else uses TrueType, so you need to declare the sources in […]
Cross-Domain AJAX Requests
Browsers prevent standard AJAX calls across domains for security reasons, but you can make JSONP calls instead. If you’re using jQuery you just need to add ‘callback=?’ to the url: $.getJSON('http://some-foreign-server.net/ajax-handler.php?param1=foo&param2=bar&callback=?', function(data) { // do stuff } ); Then setup the request handler to prepend the callback parameter to the response and wrap it in […]
Force HTTP requests in WordPress
I was working with a hosting client who wanted all of his pages to load via HTTP, except for a shopping cart. mod_rewrite rules are probably the most efficient way to do that, but we were having trouble getting that working, so I wrote a quick WordPress plugin to redirect HTTPS requests to HTTP, but allow […]
Why Cube Farms are a Bad Idea
Campaign Monitor’s blog has a post about their new office space, and in it they write about several reasons why private offices are necessary for programmers, including this quote from Paul Graham: “After software, the most important tool to a hacker is probably his office. Big companies think the function of office space is to […]