[Pas2js] bootstrap 5 modal: JQuery(...).modal is not a function

Michael Van Canneyt michael at freepascal.org
Fri Aug 11 11:53:22 CEST 2023



On Fri, 11 Aug 2023, Luca Olivetti via Pas2js wrote:

> Hello,
>
> since I need to show/hide a bootstrap 5 modal, I thought I could use the 
> TBootstrapModal defined in bootstrapwidgets, however it gives the exception 
> in the subject: "JQuery(...).modal is not a function.
> This comes from ApplyWidgetSettings:
>
> JQuery(aElement).modal(...
>
> since TBootstrap is defined as a class helper for TJQuery.
>
> I'm not an expert in web technologies, but I guess this is due to the fact 
> that libbootstrap is for bootstrap 4 and I'm using bootstrap 5.

It also works with bootstrap 5, but you must simply include jquery manually.

But having a libbootstrap5 geared towards using bootstrap without jquery 
would indeed be a good idea.

Michael.


More information about the Pas2js mailing list