Created
October 12, 2011 19:34
-
-
Save scottwater/1282281 to your computer and use it in GitHub Desktop.
Hiding the signup form
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
<script> | |
function getParameterByName(name) | |
{ | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
var regex = new RegExp(regexS); | |
var results = regex.exec(window.location.href); | |
if(results == null) | |
return null; | |
else | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
$(document).ready(function(){ | |
if(!getParameterByName('s')){ | |
$form = $('#form'); | |
$form.html('<h2>You need to find a friend with a code</h2>'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment