I'm developing a page and I import another page with popups on it using @Html.Partial("AddCommentPopup")
and on pages where I am using an <a href="#pupupIDhere" data-rel="popup etc..>
It works perfectly fine. On this page I need to do it differently though because of the way JQM works with links. So I'm using
<div onclick="console.log('divclicked');$('#statusUpdate').popup('open');">
. And the console tells me that it is being clicked, but it doesn't open the popup and throws this error:
Uncaught Error: cannot call methods on popup prior to initialization; attempted to call method 'open'.
Any idea how to fix this?
Try initializing the div as a popup first, then open it...
<div onclick="console.log('divclicked');
$('#statusUpdate').popup();
$('#statusUpdate').popup('open');">
</div>
like this i did and worked fine for me
$("#statusUpdate").popup();
$("#statusUpdate").popup('open')
you have to initialize it before opening it
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