Skip to content

Instantly share code, notes, and snippets.

@nathansmith
Created August 13, 2010 04:09
Show Gist options
  • Save nathansmith/522250 to your computer and use it in GitHub Desktop.
Save nathansmith/522250 to your computer and use it in GitHub Desktop.
Simple jQuery Jump List
$('select.jump_list').change(function() {
if (!this.value) {
return;
}
var url, url_len, last_char;
if (this.value.match('://')) {
window.top.location = this.value;
}
else {
url = window.location.toString();
url_len = url.length;
last_char = url.substring(url_len - 1, url_len);
if (last_char === '/') {
window.top.location = url + this.value;
}
else {
window.top.location = url + '/' + this.value;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment