Coding with Jesse

Setting a form field to null or undefined

I came across another browser difference while debugging some JavaScript. Let's say you were trying to set the value of a form field the following way:

document.getElementById('formField').value = someFunction();

But, it just so happens that someFunction() returns null. What happens when you set a form field value to null? Well, in Firefox and Safari, the value will be set to the empty string, "". Internet Explorer and Opera will set the field to the string "null".

Similarly, if the function forgot to return a value, the form field would get set to "undefined" (this is the same in every browser).

The moral of the story is, be careful not to let a form field value get set to null. You could avoid both these situations by doing something like:

document.getElementById('formField').value = someFunction() || "";

Note: This would actually replace undefined and null as well as 0 and false with "".

Published on April 4th, 2006. © Jesse Skinner

Let's get personal

I think personal homepages are going to be the next big thing on the Internet. Seriously, hear me out.

When the web was new, pretty much everyone got themselves a Geocities or Tripod account and set up some kind of web site. That's what's so new and special about the Internet: anyone can have a web site. Not everyone can have a TV show or a Radio show or a Magazine column. Plus, web pages can reach even more people than any TV show or Magazine can.

Then, all these companies figured out they need web sites. All you heard about was eBusiness and dot-coms and how the Internet was changing business (though nobody knew how, exactly). So the Internet started to get all corporate.

Now, "suddenly", personal web sites are big again. I'm mostly talking about blogs. But what's really special about blogs? The fact that one person can easily get a site and start writing, and build an audience, even more readers than some newspapers out there. That's pretty crazy.

The whole nature of the web makes this possible. It's totally leveled the playing field. Anyone can do good on Google without spending a cent. Good content thrives on the Internet. You just have to contribute something valuable and people will find it.

Okay, so web sites with pictures of cats aren't so interesting or revolutionary. But personal doesn't have to be boring. This site is a personal web site. It's about web development, but it's just my take on it. Stuff I've figured out, thought about, and so on. It's my personal contribution to the web development world.

So when I say personal, I mean individual. I mean that one person by themself can do bigger things on the Internet than they can in real life. They can publish a book. They can sell (or give away) their music. They can make movies. They can create a popular comic strip. They can start groups. They can start businesses. They can run a huge business just by hiring and outsourcing to other people on the web. And these other people can just be individuals too, doing the same outsourcing themselves.

There are a LOT of people who don't have web sites yet. And all of these people have special interests, passions, talents and things to say that are just hiding away. Soon, these people will make pages (whether on MySpace, blogger, LivePages, or something else). They will start to open up and share their hidden talents with the rest of us.

Everyone benefits from this. The more information and entertainment on the web, the better. The Good Stuff will rise to the top, and the more available, the better the Good Stuff gets. And, of course, the people making the Good Stuff will benefit too. This will just make more incentive to make Good Stuff, and you can see where this is going.

So what can you do? Get out there and contribute. Don't be shy. Get your drawings, pictures, movies, stories and rants on the web. Help your friends and family to do the same. Do what you love, do your best, and do it in public. Your audience will find you.

Published on March 29th, 2006. © Jesse Skinner

Review: Working at Home on the Internet

Joseph Hauckes from the Working at Home on the Internet blog has asked me to review his other site, the Working at Home on the Internet Web Page. I've been reading his blog since the beginning, and it's become one of the few blogs I read daily. He posts very regularly every day (he's only missed one day in the past six months), and it's a pleasure to watch his story evolve over time. I look forward to seeing where it goes.

Usability

The website is a collection of resources and advice for people starting their own Internet-based businesses. At first, the site looks like a blog. It takes some time to find the resources pages including Scams, Forums and Blogging Services. The links to these pages blend in to the side of the site. The site could use some clear navigation, ideally at the top of the page. This would help make the site easier to use and explore.

Design

The design is nothing spectacular, but it doesn't distract from the content either. On the homepage, the left navigation takes up most of my screen, and I have to scroll to the right to read the content. The rest of the pages don't have this problem, but it's the first impression that counts.

Web Technologies

This site was designed and built using Microsoft Frontpage. As a result, the HTML doesn't come close to validating. There's scattered inline CSS and even font tags. It's just not easy to produce valid code with WYSIWYG tools without being strong in HTML and CSS. I hear Microsoft's new HTML editor Expression is supposed to help with this.

Summary

The most important thing about any website is its content. However, it's important to make sure this information is easy to find. Joe's site may not win design awards, but it has a number of great articles to help people getting started with their own sites, and that's what counts.

Published on March 24th, 2006. © Jesse Skinner

Website Reviews

I'm going to start doing the occasional Website Review. Consider yourself warned. I figure it's worth taking a look at the good and bad parts of other sites so we can all learn from their successes and mistakes.

I'll mostly be focusing on design and usability, usage of web technologies (ie. HTML, JavaScript and CSS) and whatever else strikes me as interesting and unique.

If you have a site you'd like me to review, let me know.

Published on March 24th, 2006. © Jesse Skinner

Form field spammers

I didn't want to put my email address on the site, purely for spam reasons. I thought I could avoid spam by putting a contact form on the site instead. Now, I get more spam than I used to from comment spam bots using my contact form!

There is no escape, and I will have to accept this as a part of my destiny...

Published on March 22nd, 2006. © Jesse Skinner
<< older posts newer posts >> All posts