Skip to content

Instantly share code, notes, and snippets.

@scottwater
Created October 12, 2011 19:34
Show Gist options
  • Save scottwater/1282281 to your computer and use it in GitHub Desktop.
Save scottwater/1282281 to your computer and use it in GitHub Desktop.
Hiding the signup form
<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