Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianchristensen/524428 to your computer and use it in GitHub Desktop.
Save christianchristensen/524428 to your computer and use it in GitHub Desktop.
$('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