Sunday, September 21, 2008

Another Problem Solved

bring on the next one

I added a bookmark button to the bottom of every post. It's a cool little tool that will hopefully help get me some exposure around the 'nets. I recommend it. It's free and you can get it here.

I did have some problems with it at first. For one, it threw one of those annoying little javascript errors that you often see at the bottom left-hand corner of your browser. You know the one. It looks like a yield sign with an exclamation point in it? No? Oh well, maybe I'm just anal like that. Just take my word for it. It was there. Let's move on.

The error wasn't a problem in and of itself, until I started noticing some strange behavior with the button itself. On one post, clicking the button would reference the post above it, instead of the post I was actually clicking the button on. Confused? You're going to have to take my work for it again. It happened.

On another post the button didn't show up at all. The really frustrating part was that on most posts it worked exactly as intended! Fortunately, my incredible intellect and amazing computer skills allowed me to figure out where the problem lay. The button code didn't like me using apostrophes in post titles.

What happens is the post titles are turned into HTML links tags. The browser sees the apostrophe and, confusing it with a double quote mark, decides to end the tag early. Or, I could be talking out of my ass. It's been known to happen from time to time. I do have some experience writing SQL queries for dynamic web pages. This sort of thing used to trip me up all the time. I should have recognized it sooner and avoided some painful thinking time.

At any rate, the solution was to not use apostrophes in post titles. Instead, I use the ASCII code for an apostrophe instead, &#146 .

Hopefully you'll find this site if you are having the same problem. I'm cool like that.

Template provided by Webtalks