最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Multiple shortcodes with embedded JavaScript code in same page, how?

programmeradmin5浏览0评论

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...

发布评论

评论列表(0)

  1. 暂无评论