Javascript Events when adding or editing Widgets/Blocks (apostrophe-block)

12 views
Skip to first unread message

Fotis Paraskevopoulos

unread,
Mar 3, 2016, 11:53:38 AM3/3/16
to apostr...@googlegroups.com
Hello Tom,

What would be the right way to run some javascript code, when a widget/ block has been added.

At the moment I am adding a custom apostrophe-block, which contains the logic in a <script> tag. However it seem the <script> tags are being stripped from the markup.

How can I trigger some javascript  as soon as it is added to the document.

Best,
FP

Matthew Crider

unread,
Mar 17, 2016, 10:09:53 AM3/17/16
to apostrophenow
Hey Fotis, have you seen https://groups.google.com/forum/#!searchin/apostrophenow/javascript$20event|sort:date/apostrophenow/JTf-cZ1M6I8/SKvi1FiVApwJ ?  I just discovered the 'Players' stuff, its pretty cool -- just make sure you use the right widget name in place of slideshow (in the example there) and it will be called whenever your widget is updated.

- Matt

Tom Boutell

unread,
Mar 17, 2016, 10:10:41 AM3/17/16
to apostr...@googlegroups.com
Thanks Matt, I missed this question originally, but it's good to have other people answering questions (:

Players are the way to go. They do the right thing whether it's the initial page load or a later addition of the widget.

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com
Reply all
Reply to author
Forward
0 new messages