Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught TypeError: AJS.dialog2 is not a function

vijesh kumar March 22, 2020

Added this code:

$("#dialog-show-button").on('click', function(e) {
e.preventDefault();
AJS.dialog2("#demo-dialog").show();
});

with the dialog section in HTML.

It only worked once at the beginning, after page refresh started getting the following error:

Uncaught TypeError: AJS.dialog2 is not a function

Tried 

AJS.toInit(function($), but didn't worked.

1 answer

0 votes
Jack Nolddor _Sweet Bananas_
Atlassian Partner
March 22, 2020

Hi, what about this?

 

require(['jquery', 'aui/dialog2'], function($, dialog2) {
$("#dialog-show-button").on('click', function(e) {
e.preventDefault();
dialog2("#demo-dialog").show();
});
});

 

Regards

vijesh kumar March 25, 2020

Thanks for the response mate.

Solution didn't worked :(

Suggest an answer

Log in or Sign up to answer