Show message when DOM does not load

How can I show the message as soon as the page starts loading ... maybe it takes 1 minute to load html, etc.

This is a ticket booking website where you will start making payments using bank or credit cards. During peak hours, bank sites may load slowly or not load. During this time, I want to show a message by which the client can immediately click and return to the initial page of the reservation if the bank page does not load or continues to load for a minute or two.

When making a payment, the client can go 2-4 pages. Since POST .. is used on all pages .. using the "Back" button a cache-miss firmware error appears. However, the reservation homepage may reach the GET URL.

+5
source share
2 answers

In Firefox you can show the notification bar, and when you download it you can remove it - https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications#Using_notification_box

The notification panel can be visible in all tabs or only on a separate tab, this code makes the panel visible only on this tab:

var message = 'Another pop-up blocked'; var box = gBrowser.getNotificationBox(); var notification = box.getNotificationWithValue('popup-blocked'); if (notification) { notification.label = message; } else { var buttons = [{ label: 'Button', accessKey: 'B', popup: 'blockedPopupOptions', callback: null }]; let priority = box.PRIORITY_WARNING_MEDIUM; box.appendNotification(message, 'popup-blocked', 'chrome://browser/skin/Info.png', priority, buttons); } 
0
source

This circuit should work:

  • page 1 sends a request to page 2
  • page 2 returns a simple download page and makes an inline AJAX request for the form while the rest of the page loads.
  • AJAX callback fills the page as expected (replacing a high-level container) OR you can offer advice if too much time passes.
0
source

Source: https://habr.com/ru/post/1241304/


All Articles