Programming

Supercharge Your PHP Pages

Posted on

While working on the Swift Point Content Mangement System project I had the chance to delve deep into the fantastic world of PHP. One aspect of PHP we worked a lot on was optimisation. This went to low level details, such as the difference between single and double quotes, right through to making you web […]

Programming

Using CSS Selectors

Posted on

It has been said about CSS that you can learn it in a day, but it takes years to master. Actually, it isn’t that hard to master if you have the right information to hand. Today I’m just going to dump a load of information on CSS selectors, which is the most common CSS question […]

Programming

HTML5 and Skip to Content Links

Posted on

If you’ve done web development with any focus on accessibility, you will have found yourself creating “skip to” links on your web page. You may have noticed that I have these very links on this website and wondered what they are! The two links, “skip to navigation” and “skip to content” are of little use […]

Programming

JavaScript Short Tags and XHTML

Posted on

Here is another JavaScript question I was asked yesterday, which was catching out a developer using XHTML and an external JavaScript file. Users of XHTML will be highly familiar with the use of the “short tag” (this isn’t when you sell a load of tags you don’t yet have, speculating that the value of the […]

Programming

JavaScript Includes and Rewritten URLs

Posted on

I recently answered a question on a forum about JavaScript includes in ASP.NET MVC and as the question came up again today, I thought I’d share the answer with the world. The issue that people are coming up against is that they have a script include with a relative path to their script file. Because […]

Programming

Always Use Those Curly Braces

Posted on

I write a lot of code in a lot of different languages – but there is one common rule I apply to all of them… when you use an “if” block, always put in the curly braces even if you don’t need them. Many errors are related to violations of this simple style rule. I […]

Programming

Get NMock2 to Return Out Params

Posted on

There are plenty of mocking frameworks out there, with Rhino Mocks and Moq leading the way. Personal preferences aside, I am currently working on a project that is using NMock2 for mocking and found that the following feature isn’t very well known. In the process of adding unit tests to some legacy code, before I […]

Programming

AJAX Ready State Codes

Posted on

If you are hand-cranking an AJAX request, you’ll be looking for a Ready State of 4 and a Status of 200. But what other Ready State Codes are there and what do they mean? request.onreadystatechange = function () { alert(“readyState: ” + request.readyState); }; 0. Uninitialized 1. Set up, but not sent 2. Sent 3. […]

Browsers

Firefox About URI Schema

Posted on

The “about:” URI schema has been around since the days of Netscape, but there is more to it than the common “about:blank” reference for an empty page. Some of these options give you an advanced view over Firefox and its cache – and others a just a bit of entertainment. Here is a list of […]

Programming

Auto Load Your PHP Classes

Posted on

In PHP you can create classes to organise your code and represent objects that you want to pass around. This has long been a feature of other languages and was a fundamentally important step forward for PHP. There was one thing, though, that I didn’t like about PHP classes. If I wanted to instantiate a […]