• Resolved michmael

    (@michmael)


    Hello,

    I’ve installed Exit Notifier today and had troubles getting it work.

    I’m using wordpress 5.7.2 and Exit Notifier 1.9.1

    When using default settings, I’ll encounter the following error when clicking an external link:

    frontend.js?ver=1.9.1:88 Uncaught TypeError: jQuery.jAlert is not a function
        at HTMLAnchorElement.exit_notifier_leave_now (frontend.js?ver=1.9.1:88)
        at HTMLDocument.dispatch (jquery.js:5429)
        at HTMLDocument.elemData.handle (jquery.js:5233)
    

    jAlert.min.js and jAlert.min.css are loaded.

    Because of this error i changed to SweetAlert2 in the backend settings. The popup is displayed now, but the timeout does not work (the buttons won’t get “clicked” after the timer ends).

    I looked through your code and found the following:

    if(timeleft <= 0) {
        clearInterval(countdownTimer);
        jQuery(".confirmBtn").click();
    }
    

    When inspecting the SweetAlert2 popup, i cannot find an element with the css-class “confirmBtn”. Is it possible that this button only exists in jAlert’s popup?

    Also i wanted to thank you for making this plugin.

    Have a nice day,
    Michael

    • This topic was modified 3 years, 9 months ago by michmael.
    • This topic was modified 3 years, 9 months ago by michmael.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Curtis V. Schleich

    (@cvscvstechcom)

    Ok, the “jAlert is not a function” issue will need some troubleshooting. Can you try disabling other plugins to see if it may be an interaction with something else on your site? Do you have a test site I can take a look at?

    The second issue is expected. I’ve added SweetAlert because it handles accessibility standards better, but I do not have all of the features of the plugin working as it does with jAlert.

    Thread Starter michmael

    (@michmael)

    Thank you for your quick reply!

    I disabled all plugins and switched the theme and it turned out the issue was in the theme.

    It seems like jQuery was loaded multiple times.

    Thanks for pointing me to the right direction.

    Michael

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jAlert is not a function / Timeout not working’ is closed to new replies.