cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught Error: cannot call methods on modal prior to initialization error

Uncaught Error: cannot call methods on modal prior to initialization error

I am integrating a popup but getting below error: 
jquery.js:259 Uncaught Error: cannot call methods on modal prior to initialization; attempted to call method 'openModal'

3 REPLIES 3

Re: Uncaught Error: cannot call methods on modal prior to initialization error

Hi @johdanlusefa34  

 

If you are using the below code then try to replace it with the given code.

 

$("#modelDivId").modal("openModal");

Replace with 

 

$('#modelDivId').modal(options).modal('openModal');
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: Uncaught Error: cannot call methods on modal prior to initialization error

Thank you even i had the same problem and replacing the given code has worked for me 

Re: Uncaught Error: cannot call methods on modal prior to initialization error

jQuery(".modal .close ").trigger("click");

 Another solution: this is  worked for me.