marker anklicken zeigt infos aus datenbank in DOM an
This commit is contained in:
1 parent
6a1589227a
commit
49ba7be5ee
6 files changed
+135
-10
No files matched your search
@@ -0,0 +1,56 @@
|
||||
|
||||
|
||||
/* ideeSpeichern();
|
||||
function ideeSpeichern(titel, inhalt) {
|
||||
|
||||
let url = "system/ideeSpeichern.php";
|
||||
let formData = new FormData();
|
||||
formData.append('titel', titel);
|
||||
formData.append('inhalt', inhalt);
|
||||
fetch(url,
|
||||
{
|
||||
body: formData,
|
||||
method: "post",
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((markerData) => {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
.catch(function(error) {
|
||||
console.log("error: " + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
function ideeAnzeigen(data) {
|
||||
document.querySelectorAll('.loeschen').forEach(e => e.remove());
|
||||
let titelErstellen = document.createElement("h1");
|
||||
let titelInhalt = document.createTextNode(data.titel);
|
||||
titelErstellen.appendChild(titelInhalt);
|
||||
titelErstellen.classList.add("loeschen")
|
||||
document.getElementById('idee').appendChild(titelErstellen);
|
||||
|
||||
let inhaltErstellen = document.createElement("p");
|
||||
let inhaltInhalt = document.createTextNode(data.inhalt);
|
||||
inhaltErstellen.appendChild(inhaltInhalt);
|
||||
inhaltErstellen.classList.add("loeschen")
|
||||
document.getElementById('idee').appendChild(inhaltErstellen);
|
||||
|
||||
let likesErstellen = document.createElement("p");
|
||||
let likes = document.createTextNode(data.likes + " Likes");
|
||||
likesErstellen.appendChild(likes);
|
||||
likesErstellen.classList.add("loeschen")
|
||||
document.getElementById('idee').appendChild(likesErstellen);
|
||||
|
||||
let bild = document.createElement("img");
|
||||
bild.src = "https://upload.wikimedia.org/wikipedia/commons/f/f9/Phoenicopterus_ruber_in_S%C3%A3o_Paulo_Zoo.jpg";
|
||||
bild.classList.add("ideeBilder")
|
||||
bild.classList.add("loeschen")
|
||||
document.getElementById('idee').appendChild(bild);
|
||||
}
|
||||
Reference in new issue
Block a user