admin管理员组文章数量:1026989
I'm developing a plugin that use shortcodes to display some "special" buttons on frontend. These shortcodes generate HTML, CSS and JavaScript for the button so, if the user insert multiple shortcodes in the same page (to have more than one button), the same JavaScript code is repetead for each shortcode (button). How can I allow the user to insert multiple buttons in the same page without replicate JavaScript code more than one time?
For example: if the user insert 3 buttons on the page when one of these buttons is clicked the click event handler function is exectuted 3 times...
I'm developing a plugin that use shortcodes to display some "special" buttons on frontend. These shortcodes generate HTML, CSS and JavaScript for the button so, if the user insert multiple shortcodes in the same page (to have more than one button), the same JavaScript code is repetead for each shortcode (button). How can I allow the user to insert multiple buttons in the same page without replicate JavaScript code more than one time?
For example: if the user insert 3 buttons on the page when one of these buttons is clicked the click event handler function is exectuted 3 times...
本文标签: Multiple shortcodes with embedded JavaScript code in same pagehow
版权声明:本文标题:Multiple shortcodes with embedded JavaScript code in same page, how? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1744883031a2122125.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论