Skip to content

Instantly share code, notes, and snippets.

@rusllonrails
Created July 3, 2012 15:52
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 rusllonrails/3040625 to your computer and use it in GitHub Desktop.
Save rusllonrails/3040625 to your computer and use it in GitHub Desktop.
Bad Javascript example
$('a').click(function(){
if ( !$(this).hasClass('fancybox') ){
var href = $(this).attr('href');
if (href) { var firstChar = href.substring(0,1); }
if (href && href != '#' && firstChar != '#') {
location.href = href;
return false;
} else {
return false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment