Add JS to panel widget

How can I attach JS to my custom panel widget?

I have a list of links, inside that panel, which should have onclick eventlisteners + handlers attached to them.


You can include your script in the widget template.

Indeed, I tried to return it from the return array ‘html’ key. I replaced that with with tpl::load to load a separate file and included javascript there.


1 Like