Last change
on this file since 744 was 95, checked in by wouter, 4 years ago |
rename loggedin to welcome
|
File size:
1010 bytes
|
Rev | Line | |
---|
[70] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
---|
| 2 | <html>
|
---|
| 3 | <head>
|
---|
| 4 | <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
|
---|
| 5 | <meta content="utf-8" http-equiv="encoding">
|
---|
[71] | 6 | <title>Welcome user</title>
|
---|
| 7 |
|
---|
[70] | 8 | </head>
|
---|
| 9 | <body onload="init()">
|
---|
[71] | 10 | <h1>Welcome User <div id="name">-</div></h1>
|
---|
| 11 |
|
---|
| 12 | You logged in and have ID :
|
---|
| 13 |
|
---|
[70] | 14 | <div id="id">-</div>
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | <script>
|
---|
| 18 | "use strict";
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 | function init() {
|
---|
| 22 | var xmlHttp = new XMLHttpRequest();
|
---|
[90] | 23 | xmlHttp.open("GET", "Accounts?me", true);
|
---|
[70] | 24 | xmlHttp.onreadystatechange = function() {
|
---|
| 25 | if (xmlHttp.readyState == 4) {
|
---|
| 26 | if (xmlHttp.status == 200) {
|
---|
[91] | 27 | var res=JSON.parse( xmlHttp.responseText )[0];
|
---|
[70] | 28 | document.getElementById('name').innerHTML = res['name'];
|
---|
| 29 | document.getElementById('id').innerHTML = res['id'];
|
---|
| 30 | } else {
|
---|
| 31 | alert("access denied!");
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | xmlHttp.send();
|
---|
| 36 |
|
---|
| 37 | }
|
---|
| 38 | </script>
|
---|
| 39 |
|
---|
| 40 | <noscript>Sorry, your browser does not support JavaScript!</noscript>
|
---|
| 41 | </body>
|
---|
| 42 | </html>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.