Wednesday, August 26, 2009

Troubleshooting

Troubleshooting always sounded like a Good Idea, to me. Got a problem? Take it out back and shoot it! Who could argue against that, right?

But how do you go about figuring out why a page doesn’t work the way it should? How do you find a validation error or a missing tag that’s causing everything to load up one column over from where you need it?

Let’s break it down into two cases. New Stuff and Old Stuff.

New Stuff

If you’re building page from scratch, the task is in many ways more difficult. You have nothing to go on and you have no fond memories of it ever actually working. Start with a deep breath. It’s highly unlikely that anyone is going to die as a result of your page not working right, today. First thing’s first: Validate your page. Let the validator look through it, line-by-line, scouting for simple errors in your markup. It’s easy to miss a closing double-quote or leave off a Table Row ending tag. The validator will catch things like that.

Once you have valid markup, you may find you have solved your problem. If not, work slowly and methodically, from the outside-in. Start with the framework of your page. If your divisions and tables and images aren’t where they are supposed to be, try to build a page where they are, without all of the text and linkage and so on.

The thing you don’t want to do is to start a slash-and-burn program of markup deletion. You have a lot of calories invested in your page, and there may be some Good Ideas in there that you can rescue. It is much easier to copy-and-paste than it is to think up All New Markup, after all, so comment out entire sections of your page and work with what is left. Add-back things one at a time and measure the differences. Remember that Web browsers will ignore anything between the <!-- characters and the --> characters, including text, media tags and even markup. Select the range of text you want to “delete” from your page and comment it out, instead, using the little cartoon voice bubble icon in your Code View Toolbar. Select the Apply HTML Comment option.

From here, don’t change two things. Change one thing, and then check it. Change the next and look over those results. Change a third thing, and so on. It is much easier to find the offending markup or code this way, and then much easier to seek out a solution.

Old Stuff

Working on current pages is a little easier, but totally ego-blasting. If the page works and you monkey it up, then there is no one to blame but yourself. Before modifying a working, current page, I like to make a copy of it for safekeeping. I may have a better idea, but if I can’t bring it to life, I can always at least go back to the way it was this morning, when it maybe wasn’t pretty but at least it worked.

But the basic process is the same, even including that deep breath at first. Validate your page, first. Then, work slowly, making only a change at a time, and see how these changes affect the outcome. Don’t delete anything, comment it out and then un-comment the various sections until you have a page that is complete. In this way, as above, you will be able to instantly see what markup is breaking your page, and hopefully be able to quickly and easily change it.

Remember, though, there is no glory in spending all day in a project like this. If you have spent eight hours on a page and it still doesn’t work, you have lost a whole day. ASK someone for help in a situation like that. Spending all day on a problem doesn’t make you a hero. Nobody is going to give you a medal for something like that and it’s very possible that someone in the WDN can get you an answer quickly and easily that will speed you on your way.

No comments: