Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lehrkraefte:blc:informatik:glf22:web-tech:globalnav-in-js [2023/05/11 07:37] Ivo Blöchliger |
lehrkraefte:blc:informatik:glf22:web-tech:globalnav-in-js [2023/05/11 11:28] (current) Ivo Blöchliger [Vorbereitungen] |
||
---|---|---|---|
Line 15: | Line 15: | ||
<code html> | <code html> | ||
<nav id=" | <nav id=" | ||
- | <--! Wird durch javascript | + | <--! Wird durch das Script |
</ | </ | ||
</ | </ | ||
Line 26: | Line 26: | ||
window.addEventListener(' | window.addEventListener(' | ||
| | ||
- | document.getElementById(id).innerHTML = html; | + | |
+ | if (el) { // Nur, wenn es ein solches Element auch gibt | ||
+ | el.innerHTML = html; | ||
+ | } | ||
} | } | ||