Created
July 3, 2012 15:52
-
-
Save rusllonrails/3040625 to your computer and use it in GitHub Desktop.
Bad Javascript example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('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