How do I run javascript in a blocks edit.php?
Permalink
So I'm using a small javascript library that I've added to my blocks js directory. Everything works fine when using that js in view.php but when using the same code in edit.php the js isn't included. I read somewhere that one should add js to auto.js in the blocks root dir, which I did, but the result didn't change.
What am I doing wrong?
What am I doing wrong?
Auto.js is automatically added in edit/add.
If you want to do anything else, use addheaderItem() or addFooterItem() in an on_page_load handler in your block controller.
(Personally I usually do it all that way, so I always specify what I want loaded)