Last change
on this file since 245 was
244,
checked in by hendrikvanantwerpen, 13 years ago
|
Inlogscherm werkt met jQuery UI! Woot!
|
File size:
1.6 KB
|
Rev | Line | |
---|
[244] | 1 | $(function() { |
---|
| 2 | $("#loginForm").dialog({ |
---|
| 3 | buttons: { |
---|
| 4 | "Login": function() { |
---|
| 5 | $.ajax({ |
---|
| 6 | type: "POST", |
---|
| 7 | url: "api.php", |
---|
| 8 | contentType: "application/json", |
---|
| 9 | data: JSON.stringify({ |
---|
| 10 | action:"login", |
---|
| 11 | args:{username:$("#username").val(),password:$("#password").val()} |
---|
| 12 | }), |
---|
| 13 | success: function(data,textStatus,jqXHR) { |
---|
| 14 | $("#info").html("Succes: "+data); |
---|
| 15 | $("#loginForm").dialog("close"); |
---|
| 16 | }, |
---|
| 17 | error: function(jqXHR,textStatus,errorThrown) { |
---|
| 18 | $("#info").html("Login Failed: "+errorThrown); |
---|
| 19 | } |
---|
| 20 | }); |
---|
| 21 | }, |
---|
| 22 | "Register": function() { |
---|
| 23 | $.ajax({ |
---|
| 24 | type: "POST", |
---|
| 25 | url: "api.php", |
---|
| 26 | contentType: "application/json", |
---|
| 27 | data: JSON.stringify({ |
---|
| 28 | action:"register", |
---|
| 29 | args:{username:$("#username").val(),password:$("#password").val()} |
---|
| 30 | }), |
---|
| 31 | success: function(data,textStatus,jqXHR) { |
---|
| 32 | $("#info").val("Succes: "+data); |
---|
| 33 | }, |
---|
| 34 | error: function(jqXHR,textStatus,errorThrown) { |
---|
| 35 | $("#info").html("Register Failed: "+errorThrown); |
---|
| 36 | } |
---|
| 37 | }); |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | }); |
---|
| 42 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.