Author:

An international Developer Evangelist working for Mozilla in the lovely town of London, England.

Twitter: Follow Christian Heilmann on Twitter

Google Profile: https://plus.google.com/111552931212713155841/posts

Local Storage And How To Use It On Websites

Storing information locally on a user's computer is a powerful strategy for a developer who is creating something for the Web. In this article, we'll look at how easy it is to store information on a computer to read later and explain what you can use that for.

The main problem with HTTP as the main transport layer of the Web is that it is stateless. This means that when you use an application and then close it, its state will be reset the next time you open it. If you close an application on your desktop and re-open it, its most recent state is restored.

[fblike]

This is why, as a developer, you need to store the state of your interface somewhere. Normally, this is done server-side, and you would check the user name to know which state to revert to. But what if you don't want to force people to sign up? This is where local storage comes in. You would keep a key on the user's computer and read it out when the user returns.

Read more...

Making Your Mark On The Web Is Easier Than You Think

We who work on the Web live in wonderful times. In the past, we did of lot of trial-and-error learning, and the biggest hurdle was getting people to understand what we were on about. Over time, companies like Google, Yahoo, Skype, Facebook and Twitter managed to get the geeky Web into the living rooms of regular people and into the headlines of the mainstream press.

Future of Web Design Conference in London, 2010
Image credit

Now more than ever are there opportunities on the Web for you, as a professional, to be seen and to be found. I am a professional Web spokesperson for a large company, and I spoke at 27 conferences in 14 countries last year. I write for several magazines and blogs and have published a few books. When people ask me how I got to where I am now, my standard answer is: by releasing stuff on the Web and by listening and reacting to feedback. And you can do the same.

Read more...

Seven JavaScript Things I Wish I Knew Much Earlier In My Career

I've been writing JavaScript code for much longer than I care to remember. I am very excited about the language's recent success; it's good to be a part of that success story. I've written dozens of articles, book chapters and one full book on the matter, and yet I keep finding new things. Here are some of the "aha!" moments I've had in the past, which you can try out rather than waiting for them to come to you by chance.

Screenshot

Shortcut notations. One of the things I love most about JavaScript now is shortcut notations to generate objects and arrays. So, in the past when we wanted to create an object, we wrote...

Read more...

PHP: What You Need To Know To Play With The Web

In this article, I'll introduce you to the fundamentals of PHP. We'll focus on using PHP to access Web services and on turning static HTML pages into dynamic ones by retrieving data from the Web and by showing different content depending on what the user has entered in a form or requested in the URL. You won't come out a professional PHP developer, but you'll be well on your way to building a small page that uses Web services. You can find a lot of great PHP info on the Web, and most of the time you will end up on PHP.net itself. But I was asked repeatedly on several hack days and competitions to write this quick introduction article, so here it is.

PHP rendered in a browser

PHP is a server-side language that has become a massive success for three reasons: it is a very easy and forgiving language. Variables can be anything, and you can create them anytime you want. It is part of the free LAMP stack (Linux, Apache, MySQL, PHP) and thus available on almost any server you can rent on the Web. And it does not need a special editor, environment or build process. All you do is create a file of the .php file type, mix PHP and HTML and then put it on your server for rendering.

Read more...

Entering The Wonderful World of Geo Location

I thought I could not be out-geeked. With a background in radio, and having dabbled in the demo scene on the Commodore 64 and hung out on BBSes and IRC for a long time and all the other things normal kids don't quite get, I thought I was safe in this area.

Geomaker in action

Then I went to my first WhereCamp, an unconference dealing with geographical issues and how they relate to the world of Web development. Even my A-Levels in Astronomy did not help me there. I was out-geeked by the people who drive and tweak the things that we now consider normal about geo-location on the Web.

Pulling out your phone, find your location and getting directions to the nearest bar is easy, but a lot of work has gone into making that possible. The good news is that because of that effort, mere geo-mortals like you and me can now create geographically aware products using a few lines of code. So, let's give the geo-community a big hand.

Read more...

The Seven Deadly Sins Of JavaScript Implementation

Using JavaScript has become increasingly easy over the last few years. Whereas back in the day we needed to know the quirks of every browser, now many libraries such as jQuery, YUI, Dojo and MooTools allow someone who doesn't even know JavaScript to spruce up boring HTML documents with impressive and shiny effects. By piggy-backing on the CSS selector engine, we have moved away from the complexity and inconsistencies of the DOM and made things much easier.

The Seven Deadly Sins Of JavaScript Implementation

If you look at some of the code that has been released, though, we do seem to have taken a step backwards. In gaining easier access, we also became a bit sloppy with our code. Finding clearly structured, easy-to-maintain jQuery code is quite tough, which is why many plug-ins do the same thing. Writing one yourself is faster than trying to fathom what other developers have done.

The rules for solid, maintainable and secure JavaScript haven't changed, though. So, let's run through the seven sins of JavaScript development that will bite you in the backside when you have to maintain the code later on or hand it over to another party.

Read more...

Developing Sites With AJAX: Design Challenges and Common Issues

Almost every movie has a scene in which a character pull the protagonist aside and says, "There's something you should know about [insert another character's name here]." Most of the time, we find out some dark secret about a supposed friend of the protagonist or that the main ally is actually an evil overlord. This is that moment, and I am here to tell you a few things about our friend in the Web 2.0 world: AJAX.

Modal Pop-Up form by get satisfaction

We seem to have AJAX licked. The Web technology is ubiquitous, and libraries and frameworks make it dead easy for us to create highly interactive Web applications and to spice up our static pages and blogs.

After the main HTML document has loaded, AJAX loads content from the server and replaces parts of the document with that content rather than reload the main document. It's as simple as that. AJAX stands for "Asynchronous JavaScript and XML" and was meant to load only XML documents, but we soon used it to load everything under the sun, and so the XML part was quickly forgotten. The asynchronous part is the killer feature; but what is it?

Read more...

↑ Back to top