Plugins are executing PHP and are executed server-side.
JavaScript is embeded in them HTML page, and is executed on the client-side. You can put JS in your templates, use echo (echo is not advised in plugins) or assign your JS code to a variable in a plugin and include that variable in a template. You can however never execute JS in a plugin as JS does not execute on the server-side.
|