I try to include a js-file in a shortcode function in my plugin, unfortunately without success. :-(
plugin:
function send_mail(){
$input = "<input type='submit' value='submit' class='btn btn-primary'>";
wp_register_script('myscript', plugins_url('/js/myscript.js', __FILE__), array('jquery'), '1.0', true);
return $input;
}
add_shortcode('send', 'send_mail');
front-end-page.php
<?php echo do_shortcode('[send]');
When i load the front-end-page, there is no js included. :-( What I am doing wrong?
Thanks for your helf, Yab86