Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $('#login').click(function(){
- authentificationService("login");
- });
- $('#register').click(function(){
- authentificationService("register");
- });
- $('#list').click(function(){
- $.ajax({
- url: '/room',
- type: 'GET',
- data: {
- "do":"list"
- },
- success: function(response){
- $('#list-result').empty();
- $('#list-result').append(response);
- $('#list-result').show();
- },
- error: function(){
- $('#401').show();
- }
- });
- });
- });
- function authentificationService(service){
- var username = $('#username').val();
- var password = $('#password').val();
- $.ajax({
- url: '/auth',
- type: 'POST',
- data: {
- "service": service,
- "username": username,
- "password": password
- },
- success: function(){
- console.log("Everything went fine");
- $('#authentification').hide();
- $('#choice').show();
- },
- error: function(){
- $("*").hide;
- $('#505').show();
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment