Plugin seems not to be loading correctly PLUS trying to open programatically
-
Hello. I am trying to open a popup programatically.
Does the popup need to be active? I would like to use it only programatically but there is no option for “no trigger at all”.
Also, when I try to call it I get the following error:
“Uncaught TypeError: Cannot read property ‘showPopup’ of undefined
at (index):1”I am calling it by adding this on functions.php (inside some function):
echo “<script>”
. “console.log(‘Test started’);”
. “window.wppopups.showPopup(32655);”
. “</script>”;It’s been registered with an add_action(‘init’, ‘functionName’); and I’m getting the “Test started” on console.
I do get the “Test started” but it seems wppopups is not loading.
Even after the page is completely loaded, if I try to “window.wppopups.showPopup(32655);” on my console, I still get a “undefined” as a response.On the other hand, if I activate the popup I get the following error (which breaks my site):
“Uncaught TypeError: Cannot read property ‘charAt’ of undefined
at Object.bindPopupTriggers (wppopups.js?ver=2.1.2:317)
at Object.initPopup (wppopups.js?ver=2.1.2:147)
at HTMLDivElement.<anonymous> (wppopups.js?ver=2.1.2:106)
at Function.each (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
at jQuery.fn.init.each (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
at HTMLDocument.ready (wppopups.js?ver=2.1.2:98)
at i (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
at Function.ready (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery-1.12.4-wp.js?ver=1.12.4-wp:2)
bindPopupTriggers @ wppopups.js?ver=2.1.2:317
initPopup @ wppopups.js?ver=2.1.2:147
(anonymous) @ wppopups.js?ver=2.1.2:106
each @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
each @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
ready @ wppopups.js?ver=2.1.2:98
i @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
fireWith @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
ready @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2
J @ jquery-1.12.4-wp.js?ver=1.12.4-wp:2”Please any ideas on how to fix this?
Thank you!
- The topic ‘Plugin seems not to be loading correctly PLUS trying to open programatically’ is closed to new replies.