Commit 2a2e687c authored by Max Estefan Mahr's avatar Max Estefan Mahr

Aufgaben Abgabe

parent 6ccc2d31
...@@ -24,5 +24,29 @@ ...@@ -24,5 +24,29 @@
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings> </formatting-settings>
</DBN-SQL> </DBN-SQL>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme> </code_scheme>
</component> </component>
\ No newline at end of file
This diff is collapsed.
...@@ -2,6 +2,10 @@ h1 { ...@@ -2,6 +2,10 @@ h1 {
font-family: "Bell MT"; font-family: "Bell MT";
color: blue; color: blue;
} }
h2 {
font-family: "Arial Narrow";
color: chocolate;
}
div { div {
background-color: beige; background-color: beige;
font-family: "Arial Narrow"; font-family: "Arial Narrow";
......
...@@ -3,12 +3,45 @@ ...@@ -3,12 +3,45 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<link rel="stylesheet" href="/site/view.css"> <link rel="stylesheet" href="view.css">
<script src="/site/view.js"></script> <script src="view.js"></script>
</head> </head>
<body> <body>
<h1>Max Mahr</h1> <h1>Max Mahr</h1>
<h2>Übung 6</h2>
<p id="divplatz"> </p> <p id="divplatz"> </p>
<button id="diverstellen" type="button" onclick="divs()">Div Schleife</button> <button id="diverstellen" type="button" onclick="divs()">Div Schleife</button>
<h1 id="zahlenraten">Zahlenraten</h1>
<div id="raten">
<input id="text1" type="number" value=" "/>
<input id="Btn1" type="submit" value="Raten1"/>
</div>
<br>
<div id="schummeln">
<div>Passwort:</div><input id="text2" type="text" value=" "/>
<input id="Btn2" type="submit" value="schummeln"/>
</div>
<br>
<div id="zahlsetzen">
<div>Zahl setzen:</div><input id="text3" type="number" value=""/>
<input id="Btn3" type="submit" value="Zahl setzen"/>
</div>
<br>
<div id="result">
Response Server:<span id="data">Platzhalter</span>
</div>
</body>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -7,4 +7,38 @@ function divs() { ...@@ -7,4 +7,38 @@ function divs() {
div.textContent = summe.toString(); div.textContent = summe.toString();
} }
} }
$(document).ready(function () {
$('#Btn1').click(function () {
$("#data").html("");
var variable = $("#text1").val();
$.ajax({
url: 'http://localhost:8080/raten/' + variable,
type: 'GET',
success: function (data) { $('#data').text(data + "."); },
error: function (jqXHR, Status, error) { alert(error); }
});
});
$('#button2').click(function () {
$("#data").html("");
var passwort = $("#text2").val();
$.ajax({
url: 'http://localhost:8080/cheat?password=' + passwort,
type: 'GET',
success: function (data) { $('#data').text(data + "."); },
error: function (jqXHR, Status, error) { alert(error); }
});
});
$('#button3').click(function () {
$("#data").html("");
var passwort = $("#text2").val();
var number = $("#text3").val();
$.ajax({
url: 'http://localhost:8080/set',
type: 'POST',
data: { password: passwort, zahl: number },
success: function (data) { $('#data').text(data + "."); },
error: function (jqXHR, Status, error) { alert(error); }
});
});
});
//# sourceMappingURL=view.js.map //# sourceMappingURL=view.js.map
\ No newline at end of file
{"version":3,"file":"view.js","sourceRoot":"","sources":["view.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClB;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,CAAC,CAAC,CAAC;YACjD,KAAK,EAAE,UAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACrD,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file \ No newline at end of file
...@@ -9,3 +9,51 @@ function divs(): void { ...@@ -9,3 +9,51 @@ function divs(): void {
} }
} }
$(document).ready(function() {
$('#Btn1').click(() => {
$("#data").html("");
let variable = $("#text1").val();
$.ajax({
url: 'http://localhost:8080/raten/' + variable,
type: 'GET',
success: (data) => { $('#data').text(data+".") },
error: (jqXHR, Status, error) => { alert(error) }
});
});
$('#button2').click(() => {
$("#data").html("");
let passwort = $("#text2").val();
$.ajax({
url: 'http://localhost:8080/cheat?password=' + passwort,
type: 'GET',
success: (data) => { $('#data').text(data+"."); },
error: (jqXHR, Status, error) => { alert(error); }
});
});
$('#button3').click(() => {
$("#data").html("");
let passwort = $("#text2").val();
let number = $("#text3").val();
$.ajax({
url: 'http://localhost:8080/set',
type: 'POST',
data: {password: passwort, zahl: number},
success: (data) => { $('#data').text(data+"."); },
error: (jqXHR, Status, error) => { alert(error); }
});
});
});
...@@ -24,5 +24,29 @@ ...@@ -24,5 +24,29 @@
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings> </formatting-settings>
</DBN-SQL> </DBN-SQL>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme> </code_scheme>
</component> </component>
\ No newline at end of file
This diff is collapsed.
...@@ -175,5 +175,4 @@ $(function () { ...@@ -175,5 +175,4 @@ $(function () {
}); });
}); });
} // end of namespace AJAX } // end of namespace AJAX
...@@ -31,6 +31,7 @@ var BOOTSTRAP; ...@@ -31,6 +31,7 @@ var BOOTSTRAP;
this.saveBtn = $("#editSaveBtn"); this.saveBtn = $("#editSaveBtn");
this.editWindow = $("#editWindow"); this.editWindow = $("#editWindow");
this.resultWindow = $("#resultWindow"); this.resultWindow = $("#resultWindow");
this.DeleteUser = $("#DeleteBtn");
} }
/** /**
* Creates new User with Attributes from Inputfields * Creates new User with Attributes from Inputfields
...@@ -181,7 +182,7 @@ var BOOTSTRAP; ...@@ -181,7 +182,7 @@ var BOOTSTRAP;
this.userTable.empty(); this.userTable.empty();
//--- set table header and for each user a table-row //--- set table header and for each user a table-row
if (userList.length > 0) { // there are users in list -> print header if (userList.length > 0) { // there are users in list -> print header
this.userTable.append($("\n\t\t\t\t\t<div class=\"row bg-info\">\n\t\t\t\t\t\t<div class=\"col-5 justify-content-center\">Vorname</div>\n\t\t\t\t\t\t<div class=\"col-5 justify-content-center\">Nachname</div>\n\t\t\t\t\t\t<div class=\"col-2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t")); this.userTable.append($("\n\t\t\t\t\t<div class=\"row bg-info\">\n\t\t\t\t\t\t<div class=\"col-5 justify-content-center\">Vorname</div>\n\t\t\t\t\t\t<div class=\"col-5 justify-content-center\">Nachname</div>\n\t\t\t\t\t<div>\n\t\t\t\t"));
} }
var evenRow = true; // row-number is even var evenRow = true; // row-number is even
for (var _i = 0, userList_1 = userList; _i < userList_1.length; _i++) { for (var _i = 0, userList_1 = userList; _i < userList_1.length; _i++) {
...@@ -243,6 +244,21 @@ var BOOTSTRAP; ...@@ -243,6 +244,21 @@ var BOOTSTRAP;
this.resultWindow.addClass("bg-success"); this.resultWindow.addClass("bg-success");
} }
}; };
UserList.prototype.deleteallusers = function (id) {
var _this = this;
$.ajax({
url: 'http://localhost:8080/users/',
type: 'DELETE',
dataType: 'json',
error: function (jqXHR) {
_this.renderResult(jqXHR.responseJSON.message, jqXHR.status);
},
success: function (data) {
_this.renderResult(data.message, 0);
_this.renderList(data.userList);
}
});
};
return UserList; return UserList;
}()); }());
/********************************************************************************************************************** /**********************************************************************************************************************
...@@ -266,11 +282,18 @@ var BOOTSTRAP; ...@@ -266,11 +282,18 @@ var BOOTSTRAP;
$("#createBtn").on("click", function () { $("#createBtn").on("click", function () {
userList.createUser(event); userList.createUser(event);
}); });
$("#vornameInput, #nachnameInput").on("keyup", function (event) { $("#EditBtn").on("click", function () {
if (event.which === ENTER_KEY) { userList.renderEdit(event); // leider verstehe ich nicht wieso der Edit Button nicht das macht was er soll...
userList.createUser(event); });
} // only if "enter"-key (=13) is pressed $("#DeleteBtn").on("click", function () {
userList.deleteallusers(UserList.length); //Delete funktioniert zwar aber leider kommt man immer auf die Startseite...
$("#vornameInput, #nachnameInput, #nutzernameInput, #passwortInput").on("keyup", function (event) {
if (event.which === ENTER_KEY) {
userList.createUser(event);
} // only if "enter"-key (=13) is pressed
});
}); });
//Server erhält Daten vom Nutzer
}); });
})(BOOTSTRAP || (BOOTSTRAP = {})); // end of namespace BOOTSTRAP })(BOOTSTRAP || (BOOTSTRAP = {})); // end of namespace BOOTSTRAP
//# sourceMappingURL=clientBS.js.map //# sourceMappingURL=clientBS.js.map
\ No newline at end of file
...@@ -36,6 +36,9 @@ class UserList { ...@@ -36,6 +36,9 @@ class UserList {
private saveBtn : JQuery = $("#editSaveBtn"); private saveBtn : JQuery = $("#editSaveBtn");
private editWindow : JQuery = $("#editWindow"); private editWindow : JQuery = $("#editWindow");
private resultWindow : JQuery = $("#resultWindow"); private resultWindow : JQuery = $("#resultWindow");
private DeleteUser : JQuery = $("#DeleteBtn");
/** /**
* Creates new User with Attributes from Inputfields * Creates new User with Attributes from Inputfields
...@@ -191,8 +194,7 @@ class UserList { ...@@ -191,8 +194,7 @@ class UserList {
<div class="row bg-info"> <div class="row bg-info">
<div class="col-5 justify-content-center">Vorname</div> <div class="col-5 justify-content-center">Vorname</div>
<div class="col-5 justify-content-center">Nachname</div> <div class="col-5 justify-content-center">Nachname</div>
<div class="col-2"></div> <div>
</div>
`)); `));
} }
let evenRow = true; // row-number is even let evenRow = true; // row-number is even
...@@ -254,9 +256,23 @@ class UserList { ...@@ -254,9 +256,23 @@ class UserList {
this.resultWindow.addClass("bg-success"); this.resultWindow.addClass("bg-success");
} }
} }
public deleteallusers(id: number): void {
$.ajax({
url : 'http://localhost:8080/users/',
type : 'DELETE', // DELETE-request for DELETE
dataType : 'json', // expecting json
error : (jqXHR) => {
this.renderResult(jqXHR.responseJSON.message, jqXHR.status)
},
success : (data) => {
this.renderResult(data.message, 0);
this.renderList(data.userList)
},
});
}
} }
/********************************************************************************************************************** /**********************************************************************************************************************
* Main Event Listener, that waits until DOM is loaded * * Main Event Listener, that waits until DOM is loaded *
* - handle click on collapsable items in myContent -> hide all that are shown * * - handle click on collapsable items in myContent -> hide all that are shown *
...@@ -265,30 +281,37 @@ class UserList { ...@@ -265,30 +281,37 @@ class UserList {
**********************************************************************************************************************/ **********************************************************************************************************************/
$(function () { $(function () {
//-- instantiate UserList array -------------------------------------------------------------------------------------- //-- instantiate UserList array --------------------------------------------------------------------------------------
let userList: UserList = new UserList(); let userList: UserList = new UserList();
//-- initially read UserList (in case of other client already included users) ----------------------------------------
userList.readUserlist();
//-- initially read UserList (in case of other client already included users) ---------------------------------------- //-- handle click on collapsable items in myContent -> hide all that are shown ---------------------------------------
userList.readUserlist(); // see: https://getbootstrap.com/docs/4.0/components/collapse -> JavaScript
let contentArea: JQuery = $('#contentArea'); // consider only elements in contentArea
contentArea.on('show.bs.collapse', () => { // handles event "show.bs.collapse"
contentArea.find('.collapse.show').collapse('hide'); // find shown and hide them
});
//-- handle click on collapsable items in myContent -> hide all that are shown --------------------------------------- //--- define handler for clicking add-button or <cr> respectively ----------------------------------------------------
// see: https://getbootstrap.com/docs/4.0/components/collapse -> JavaScript $("#createBtn").on("click", () => {
let contentArea: JQuery = $('#contentArea'); // consider only elements in contentArea userList.createUser(event);
contentArea.on('show.bs.collapse', () => { // handles event "show.bs.collapse" });
contentArea.find('.collapse.show').collapse('hide'); // find shown and hide them $("#EditBtn").on("click", () => {
}); userList.renderEdit(event); // leider verstehe ich nicht wieso der Edit Button nicht das macht was er soll...
});
$("#DeleteBtn").on("click", () => {
userList.deleteallusers(UserList.length); //Delete funktioniert zwar aber leider kommt man immer auf die Startseite...
//--- define handler for clicking add-button or <cr> respectively ----------------------------------------------------
$("#createBtn").on("click", () => {
userList.createUser(event);
});
$("#vornameInput, #nachnameInput").on("keyup", (event: JQuery.Event) => {
if (event.which === ENTER_KEY) {
userList.createUser(event);
} // only if "enter"-key (=13) is pressed
});
}); $("#vornameInput, #nachnameInput, #nutzernameInput, #passwortInput").on("keyup", (event: JQuery.Event) => {
if (event.which === ENTER_KEY) {
userList.createUser(event);
} // only if "enter"-key (=13) is pressed
});
});
//Server erhält Daten vom Nutzer
} // end of namespace BOOTSTRAP } // end of namespace BOOTSTRAP
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
</head> </head>
<body> <body>
<!-- Header ----------------------------------------------------------------> <!-- Header ---------------------------------------------------------------->
<nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top "> <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top ">
<a class="navbar-brand" href="#">UserMan ClientServer</a> <a class="navbar-brand" href="#">UserMan ClientServer</a>
...@@ -73,6 +72,10 @@ ...@@ -73,6 +72,10 @@
<div class="col-5"> <input id="nutzernameInput" type=text placeholder="nutzername" /> </div> <div class="col-5"> <input id="nutzernameInput" type=text placeholder="nutzername" /> </div>
<div class="col-5"> <input id="passwortInput" type=text placeholder="passwort"/> </div> <div class="col-5"> <input id="passwortInput" type=text placeholder="passwort"/> </div>
<div class="col-2"> <button class="btn btn-info btn-sm" id="createBtn">Add</button> </div> <div class="col-2"> <button class="btn btn-info btn-sm" id="createBtn">Add</button> </div>
<div>
<div class="col-2"> <button class="btn btn-info btn-sm" id="EditBtn">Edit</button> </div>
<div class="col-2"> <button class="btn btn-info btn-sm" id="DeleteBtn">Delete</button> </div>
</div>
</form> </form>
</div> </div>
<!-- UserList --> <!-- UserList -->
...@@ -94,6 +97,7 @@ ...@@ -94,6 +97,7 @@
<div class="modal-body"> <div class="modal-body">
<input id="editVorname" type="text" title="edit Vorname"/> <input id="editVorname" type="text" title="edit Vorname"/>
<input id="editNachname" type="text" title="edit Nachname"/> <input id="editNachname" type="text" title="edit Nachname"/>
<input id="editPasswort" type="text" title="edit Passwort"/>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
......
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" />
</settings>
</component>
\ No newline at end of file
This diff is collapsed.
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Übung 6</title> <title>Übung 6</title>
<link rel="stylesheet" href="/site/style.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="/jquery/jquery.js"></script> <script src="/jquery/jquery.js"></script>
<script src="/site/script.js"></script> <script src="/site/script.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
</head> </head>
<body> <body>
<h1>Sessions</h1> <div>
<div id="form">
<div> ersteVariable: </div> <input id="erstevariableinput" title='' type='number' name='erstevariable' value='' /> (read/update/delete)<br/>
<br /> <h3>Session</h3>
<div></div>
<button id='createBtn' type='submit'> create variable </button> <div>
<button id='readBtn' type='submit'> read variable </button>
<button id='updateBtn' type='submit'> update variable </button> <button id="getSessionBtn" class="btn btn-info">
<button id='deleteBtn' type='submit'> delete variable </button> Session abrufen
<br /> </button>
<br />
<div></div> <div id="SessionCode" class="code">
<button id='readListBtn' type='submit'> read variables </button> <code></code>
<button id='deleteListBtn' type='submit'> delete variables </button> </div>
</div>
<div>
<button id="deleteSessionBtn" class="btn btn-info">
Session löschen
</button>
</div>
<hr>
<h3>Variable</h3>
<div>
<div>
<input type="text" id="KeyAnlegen">
<label for="KeyAnlegen">Key</label>
</div>
<div>
<input type="text" id="Variableanlegen">
<label for="Variableanlegen">Wert</label>
</div>
<button id="VariableBtn" class="btn btn-info">
Variable anlegen
</button>
</div>
<div>
<div>
<input type="text" id="deleteVariableKey">
<label for="deleteVariableKey">Key</label>
</div>
<button id="deleteVariableBtn" class="btn btn-info">
Variable löschen
</button>
</div>
<hr>
<h3>MaxAge</h3>
<div>
<div>
<input type="text" id="Zeit">
<label for="Zeit">Zeit [Sekunden]</label>
</div>
<button id="ZeitsetzenBtn" class="btn btn-info">
Zeit setzen
</button>
</div>
<div>
<button id="ZeitlöschenBtn" class="btn btn-info">
Zeit löschen
</button>
</div>
</div> </div>
<div id="container"></div>
<div id="data"></div> <button id="demoBtn" type="button" class="btn btn-info">Demo</button>
<button class="btn btn-info" type="button"></button>
</div>
<script>
(function() {
'use strict';
let Container = document.querySelector('#demo');
let Button = document.querySelector('#demoBtn');
Button.addEventListener('click', function() {
'use strict';
let data = {message: document.querySelector('#demo').getAttribute('msg')};
Container.show(data);
});
}());
</script>
<script language="javascript" type="text/javascript" src="script.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
$(function () { function getSession() {
$("#container").text("jQuery läuft..."); $.ajax({
}); url: 'http://localhost:8080/session',
var AJAX; type: 'GET',
(function (AJAX) { dataType: 'json',
/********************************************************************************************************************** success: function (data) {
* Class "User": represents all data of a user in the userList - class is exported (needs ES6) * console.log("getSession", data);
**********************************************************************************************************************/ $('#SessionCode').find('code').html(JSON.stringify(data));
var session = /** @class */ (function () { },
function session() { error: function (jqXHR) {
$('#demo').attr({ msg: jqXHR.responseJSON.message });
$('#demo').click();
} }
return session; });
}()); }
function render(message, session) { function deleteSession() {
var buffer = ""; $.ajax({
//--- render message -------------------------------------------------------- url: 'http://localhost:8080/session',
buffer += "<div id='serverMessage'> " + message + "</div>\n"; type: 'DELETE',
//--- render table (only if userData exists) -------------------------------- dataType: 'json',
if (erstevariable.length > 0) { success: function (data) {
buffer += "<div id='userList'>\n"; console.log("deleteSession", data);
buffer += " <table>\n"; getSession();
buffer += " <tr>\n"; $('#demo').attr({ msg: "Session gelöscht!" });
buffer += " <th style='width:20px '> id </th>\n"; $('#demo').click();
buffer += " <th style='width:100px'> vorname </th>\n"; },
buffer += " <th style='width:100px'> nachname </th>\n"; error: function (jqXHR) {
buffer += " <th style='width:100px'> nutzername </th>\n"; $('#demo').attr({ msg: jqXHR.responseJSON.message });