Developing with # Marks in Your URL Address

As the web world continues to granulate and become ever more complex with routing, client side scripting, and communication, the shape of how we use URL’s continues to extend. It’s very common to see these pound marks in URL’s which provide website functions very different from their original specifications. Pound symbols were originally intended as an HTML4.01 anchor reference. Using a <a href=” page.html#myanchor”>The Link</a> you could navigate to a specific location on a page, where ever your <a name=”myanchor”>&nbsp;</a> was located. These days though, more #’s are being used in much more innovative ways.

So Phil, why the heck are you telling me this? Well, these little # symbols are adding yet another functionality to what we can do on pages, let me give you a couple of things you can now, and always have been able to, do with #’s in your URL.

Pandora uses # symbols to stay on the same page, while JavaScript is used to pick up the change in links. Then the JavaScript routes the new variables, like selecting a new station, and submits it to it’s Flash player via ActionScript. Never have to do a page reload, never worried about complex DOM tracking, simply instruct the Flash player via a clean and simple Link.

URL Rewrite Emulation
Man, do I love URL Rewrites. These guys really clean up links and do a vast number of wonders on Search Engine Optimization. But sometimes your environment gets too cluttered with rewrites or you don’t have access to rewrites, something needs to be tunneled, or you are stuck in a monstrous CMS which has your hands tied and legs bound. Using #’s in your URL, sent to a Server Side script, then utilizing the Server Side script to read and interpret is an easy option.

Cleaner than ?URL=variables
The previous example, using Server Side URL reading via rewrite emulation always begs the question of, why not just use a variable on your request. Again this comes back to SEO and how clean #’s make your URL address look. Take a look at how Twitter is done, using a /#!/. It’s almost like Twitter uses the pound as a piece of flare or something.

Anyways, that’s just a brief on these # signs in URL addresses. Keep an eye out for them, they are used everywhere. I recently utilized #’s, while stuck in a CMS, which were JavaScript read and utilized for domain name branding. You can also use them for layout size instruction, reference variables, all sorts of things. Let me know if you find more examples and I’ll decode how they are being used.

About Phillihp Harmon

I'm Phillihp. My name can be spelled the same way forwards and backwards, so can my posts... if you wish. I'm out here exploring, learning, and sharing what I find. This is more for fun and personal growth, I aim to be as consistent as possible, so check back daily!
This entry was posted in HTML5/CSS3, Twitter. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *