Lagere die Definition der Funktion in ein script-Tag aus. Und wenn Du den Code dann noch sinnvoll einrückst, wird das Ganze gleich viel übersichtlicher:
Code
<div style="text-align: center; font-size: 13px; margin-top: 10px;">
<a onclick="popupCenter({ url: 'thread1404-onclick-event.html', title: 'Popup', w: 350, h: 750 });">
<strong>NN</strong>
</a>
<br />
<a href="#ort">Ort</a> (Südost)
</div>
<script>
const popupCenter = ({ url, title, w, h }) => {
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
const width = window.innerWidth || document.documentElement.clientWidth || screen.width;
const height = window.innerHeight || document.documentElement.clientHeight || screen.height;
const systemZoom = width / window.screen.availWidth;
const left = (width - w) / 2 / systemZoom + dualScreenLeft;
const top = (height - h) / 2 / systemZoom + dualScreenTop;
const newWindow = window.open(url, title, `scrollbars=yes, width=${w / systemZoom}, height=${h / systemZoom}, top=${top}, left=${left}`);
if (window.focus) {
newWindow.focus();
}
};
</script>
Alles anzeigen
Und in Zukunft benutze bitte Script-Tags beim beim Posten von Code, dann tauchen kein Emojis auf.