Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
Created January 4, 2013 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SlexAxton/4458459 to your computer and use it in GitHub Desktop.
Save SlexAxton/4458459 to your computer and use it in GitHub Desktop.
The worst JavaScript I've ever mistaken for working code.
<script type="text/javascript">
(function() {
("#URL").change(function() {
if ((this).val()) {
window.open((this).val());
("#formElement").submit();
}
});
});
</script>
<form id="formElement" method="get" action="#">
<select name="URL" id="URL" onchange="window.location.href= this.form.URL.options[this.form.URL.selectedIndex].value">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment