I use json to set up one of my plugin page user controls. I would like to add the following script in the page flow, having a php page to bring to the browser the needed data.
Code: Select all
<script type='text/javascript' src='" . plugin_file( 'data_source.php' ) . "'></script>
In addition, the data should be only loaded only for one of the pages, and the only way I found to add it in a safe way, is writing the pluging setup file, hooking the EVENT_LAYOUT_RESOURCES event.
How can I add scripts per page?
Thank you in advance