Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'open' of undefined #270

Open
YingChen-dci opened this issue Dec 13, 2016 · 4 comments
Open

Uncaught TypeError: Cannot read property 'open' of undefined #270

YingChen-dci opened this issue Dec 13, 2016 · 4 comments

Comments

@YingChen-dci
Copy link

YingChen-dci commented Dec 13, 2016

Hi,
I am using 1.1.0 to implement modal window. However it keep showing the following error whenever I tried our code or the example code you provided on the README page. Does anyone has any suggestion??

Error: ** the error shows up when open modal window.
Uncaught TypeError: Cannot read property 'open' of undefined

Code:
HTML:

<div class="remodal" data-remodal-id="modal">
  <button data-remodal-action="close" class="remodal-close"></button>
  <p>
    Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
  </p>
  <br>
  <button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>

JS:

    $(document).on("click", "#user-add-btn", function() {
        var modal = $('[data-remodal-id=modal]').remodal(option);
        modal.open();  <- error pointed here**
    });
@dylanjt
Copy link

dylanjt commented Jan 5, 2017

+1, I'm running into the same issue.

@panoply
Copy link

panoply commented Jan 7, 2017

+1 need a fix on this. Issue occurs when initialising Remodal with data-remodal-target attribute opposed to using href. Issue when using TurboLinks 5:

VM6680:2 Uncaught TypeError: Cannot read property 'open' of undefined at HTMLButtonElement.<anonymous> (<anonymous>:2:24907) at HTMLDocument.o (<anonymous>:2:10000) at HTMLDocument.i.proxy (<anonymous>:2:7525)

@guithib
Copy link

guithib commented Jan 12, 2017

+1 I am facing the same error.

Here the console info for the remodal.min.js file:

Uncaught TypeError: Cannot read property 'open' of undefined
at HTMLAnchorElement.<anonymous> (remodal.min.js:756)
at HTMLDocument.dispatch (jquery.js?ver=1.11.3:4)
at HTMLDocument.r.handle (jquery.js?ver=1.11.3:4)

(anonymous) @ remodal.min.js:756
dispatch @ jquery.js?ver=1.11.3:4
r.handle @ jquery.js?ver=1.11.3:4

Does someone found a fix?

@panoply
Copy link

panoply commented Jan 12, 2017

This issue occurs when using data-attribute to open Remodal. Issue was resolved opening by anchor href eg: <a href="#remodal">Open</a>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants