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:41] Ivo Blöchliger [Das Script] |
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; // Nur etwas tun, wenn es auch ein solches Element gibt | + | |
+ | if (el) { // Nur, wenn es ein solches Element | ||
+ | el.innerHTML = html; | ||
+ | } | ||
} | } | ||