Archive for the 'Web Development' Category
When implementing an HTML form that requires validation, a developer must make a decision: should I use client-side validation, server-side validation, or both?
In this article I will give a quick overview of the pros and cons of these validation techniques, as well as introduce my solution to the problem: Pajama.
Cookies are ubiquitous on the web. They’re used to store usernames, login tokens, shopping cart contents, and so on. In libraries, cookies are typically modeled as name-value pairs. An API consumer requests a cookie using a known name (e.g.
$.cookie('user') in jQuery with the Cookie plugin) and the library returns a string (e.g.
|| perform short-circuited evaluation. Essentially, this means that a program, when evaluating boolean operators, will only evaluate as many arguments as is necessary to determine the value of a boolean expression. Sometimes, however, this is not the behaviour we want.
This article assumes you have read the first part of this series.
You may not know this, but whenever you use jQuery commands like
delay, you are implicitly making use of a jQuery queue behind the scenes. That queue is named
fx, and it is the default queue that all animations use unless otherwise specified.
In this article, we will look at how jQuery animation queues work, how to create and manipulate them, and how to use them in a meaningful way.
For his 1986 book The Blind Watchmaker, Richard Dawkins developed a program that created “biomorphs”: virtual creatures created by a computer simulation. The simulation, called Biomorph, was developed in order to demonstrate the power of natural selection.
Ever wanted to filter a query_posts call by template? If you’re reading this post, you probably have or need to right now. You probably went to the query_posts documentation and scanned for something like “template=foo” and were deeply disappointed. Then maybe, in an act of desperation, you started to trudge around the plugin library. Stop! Stop right there! You don’t need a plugin to do this. Everything you need is already in WordPress.
If you’ve ever used the .NET Framework version 3.5 of later, you’ll probably have encountered extension methods. Microsoft describes extension methods as:
Extension methods enable you to “add” methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type.
In this article, I will show you how to write a base class that will allow you to add methods to any PHP class that inherits from it at runtime. You will be able to call these methods transparently, without any special syntax.