Skip to content

Instantly share code, notes, and snippets.

@iamfunsho iamfunsho/block13.js Secret
Created Oct 24, 2017

What would you like to do?
//Registration form submission
$('.join').on("submit", function(e) {
$('.submit').prop('disabled', true);
//Register user
$.post('/user', {user: $('.username').val()})
if(res.status === 200){
window.location = 'chat/'+$('.username').val();
$('.submit').prop('disabled', false);
$('.join').prepend('<p class="alert">The username is already taken!</p>');
$('.alert').fadeOut(500, function () {
}, 2000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.