Browse Source

Change page title when loading another page

jeremiewcz 1 year ago
parent
commit
0aadd35892
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      app/static/js/app.js

+ 6
- 3
app/static/js/app.js View File

@@ -69,9 +69,12 @@ function loadContent(target) {
69 69
 
70 70
 function displayMain(data) {
71 71
     document.getElementsByTagName("main")[0].innerHTML = data["content"];
72
-    if data["title"] { document.getElementsByTagName("title")[0].innerHTML = data["title"];}
73
-    if data["description"] { document.getElementsByName("description")[0].innerHTML = data["description"]; }
74
-
72
+    if (data["title"]) { document.getElementsByTagName("title")[0].innerHTML = data["title"] + " | Radio Rhino";}
73
+    else { document.getElementsByTagName("title") = "Radio Rhino"}
74
+    if (data["description"] != "undefined") {
75
+      document.getElementsByName("description")[0].innerHTML = data["description"]; }
76
+    else {
77
+      document.getElementsByName("description")[0].innerHTML = "Radio radicale pour personnes sensibles." ; }
75 78
 }
76 79
 
77 80
 function checkLive() {

Loading…
Cancel
Save