Safari does not show a confirm
window with code served from a remote host. After onclick
Safari freezes without any message in the javascript console. The same code does work when it is served from a local host and the code works in Chrome, whether served from remote host or local host.
Does anyone have any idea?
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
confirm("Press a button!");
}
</script>
Version: Safari version 12.0.1, MacOS Mojave version 10.14.1
I ended up restarting my MacBook (which I rarely do) and guess what...problem solved. The HTML confirm
in Safari is not a problem anymore.
I did not change any code on my remote host in the meanwhile. And it really surprises me that the HTML/Javascript code from one remote host (w3schools) works and the same code served from the other remote host (my remote host) does not work. After the restart of my computer (not just the browser) the confirm popup works like it did before.
I don't exactly know when I last updated the MacBook due to auto-update preferences. I guess restarting the computer from time to time isn't that bad.