I run a web page in iPhone Safari. The page has a button. on clicking it, will show an alert message box. This is OK. Then, I change or add # hash URL by typing in the address bar, then, alert message box stop working. I click the button, and nothing happens. No javascript error but no alert message box.
Is this iOS Safari known issue?
Please share your thoughts and the solution you have come up with. Many Thanks!
$(".button").click(function () { alert('Hello'); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script> <input class="button" type="button" value="alert" />
Note:
Apple says two of its goals with the new Safari in iOS 15 were making “controls easier to reach with one hand” and putting “content front and center.” There's no doubt it will take some getting used to as there's some muscle memory to rewrite.
How to Change Default Browser on iPhone 1 Go to Settings and scroll until you find the third-party app. 2 Tap the app, then tap Default Browser App. 3 Select a web browser to set it as the default. A checkmark should appear next to the browser to confirm it's the default. See More....
Open your iPhone or iPad's Settings . It's the gear icon typically found on the home screen. Scroll down and tap Safari. It's in the 5th group of settings. Scroll down to the "SETTINGS FOR WEBSITES" SECTION. It's toward the bottom of the menu.
Instead, go to "Safari" in the Settings app, choose "Default Mail App," then pick "Safari." When Safari is the default on your system, this menu item will not appear in Safari's settings — only in the settings for third-party browsers. This is, no doubt, Apple's way of silently discouraging you from moving away from its own app.
Launch the redesigned iOS 15 Safari app and visit a website. Tap the more icon (three dots inside a circle). Tap Reader to see the webpage in distraction-free reader mode. Follow the same steps to exit it. Tap the more icon again and select Reader Mode Settings for further customization.
Could be related to Alert, confirm, and prompt not working after using History API on Safari, iOS and https://forums.developer.apple.com/thread/65054
It seems that alert()
becomes undefined
. A suggested workaround is to use custom popups instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With