Reminiscing about the history of the <script> tag ritual

When JavaScript was first introduced, browsers treated the contents of script tags as regular content. To be Netscape 1.0 compatible, you had to add HTML comments. Even though the comments became unnecessary in the mid 1990s, they are STILL used in many places around the web today.

Read ›

Simple and Effective Fix for the WordPress wpautop() Madness

You may be familiar with the problems related to WordPress wpautop() function. The most notable problem is that your WordPress pages will leave you with empty paragraphs. The empty paragraphs can't be removed by simply removing <p></p> with a find and replace. It turns out that the result HTML doesn't actually have <p></p>. But the empty paragrapsh do show up in the DOM tree.

Read ›

Before You Use Captcha: Form Protection Tips

I ran into a great post on the PHP devnetwork forums here talking about some tactics to protect your forms without using Captcha.

First is the Honeypot method. The idea is to add a field to the form that bots would likely fill out but that is a hidden element on the form that should remain blank. twindev explains:

Read ›

Long Text Lines in Webkit

I got a report that a long link was overflowing in Chrome 16 and Safari 5.1:

screenshot

Read ›

Canvas Fountain Demo

I got a kick out of this canvas demo from Mozilla.

Read ›

A JavaScript Phone: Microsoft's Night Terrors

Today Mozilla announced their proposal for providing phone-like functionality to the browser in this hacks.mozilla.org article. Their goal is to provide "basic HTML5 phone experience within 3 to 6 months."

Specifically, they want to provide JavaScript APIs for accessing the phone dialer, address book, SMS, and more. We already have support on Android and iOS for getting geolocation data from GPS. There is also some support for taking photos using only JavaScript. And don't forget the FileReader and FileWriter APIs.

Read ›

Google Plus Icon in CSS Using a Single Empty Div

I was inspired by the idea that you can make a wide range of shapes using only CSS on a single div after reading this css-trics.com page. A few days ago I created a Facebook Icon using a single empty div. Today I created the Google Plus Icon using a single empty div:

Read ›

Facebook Icon in CSS Using a Single Div

I was inspired by the idea that you can make a wide range of shapes using only CSS on a single div after reading this css-trics.com page. I created the Facebook Icon using a single div:

Read ›

Browser Rendering - Getting Computed Style is Hard

Recently I was looking into how libraries like jQuery get the compute style of an element. I found that in its simplest form, getting computed style is one step:

function getStyle(el, prop) {
	return el.currentStyle ?
		el.currentStyle[prop] : // IE
		document.defaultView.getComputedStyle(el, "")[prop];
}

Read ›

You Are Using SPDY and Don't Even Know It

igvita.com explains what SPDY is, how it works and where it is used. As you may remember, Google proposed an add-on to HTTP that was faster because of multiplexing, server pushing and better compression including compression of headers and the use of a pre-defined dictionary.

Read ›