UP Javascript

Well I've started using Firebird after hearing about it from these weblogs. So far I like it and I think I'm about to make it my default browser.

One thing I'm missing from my google toolbar in IE is the Up button to take me up one directory level. So I was thinking of a way to do this and so I decided to write a small bookmarklet:

javascript:var loc=location.href.match(/(\w+:\/\/[\w.]+\/(?:[^\s\/]*\/)*)[^\s\/]+\/?/); if(loc!=null) void(location.href=loc[1]); UP

I threw together a regular expression to parse the url to get the parent. I thought some other people may find this useful so there it is.

NOTE: I have only tested this lightly in IE 6 and Firebird 0.6
Published Monday, June 23, 2003 10:00 PM by puzzlehacker

Comments

# Digger extension

Hi,

I believe their is a Firebird extension that handles this and other useful functions, called Digger.
http://clav.port5.com/

The bookmarklet is nice though, I like bookmarklets ;-)

Tuesday, June 24, 2003 2:57 AM by Dumky

# re: UP Javascript

Try the Firebird Digger extension (http://texturizer.net/firebird/extensions.html#Digger).

Tuesday, June 24, 2003 1:00 PM by rick

# re: UP Javascript

doh!

Tuesday, June 24, 2003 1:01 PM by rick

# re: UP Javascript

It also works in the latest Opera 7.21. That's some compact code! I've though of doing something similar but it would probably be 10 times longer. Bravo!

BTW, could you modify this code a little so it can also be used to dig subdomains? For example: http://a1.news.yahoo.com/ would become http://news.yahoo.com/ and then http://yahoo.com/ ? That would really be useful for me. :)

Saturday, October 18, 2003 4:37 AM by Angolmois

# Javascript UP Bookmarklet

Sunday, April 04, 2004 6:02 PM by TrackBack

# Javascript UP Bookmarklet

Sunday, April 04, 2004 6:05 PM by TrackBack

# Javascript UP Bookmarklet

Sunday, April 04, 2004 6:08 PM by TrackBack

Leave a Comment

(required) 
(required) 
(optional)
(required)