I'm learning about shortcodes and javascript.
I've simplified my problem as much as possible. In my shortcode's php file I wp_enqueue script1_javascript.js and script2_jquery.js. The first script is javascript and the second is a jQuery script.
In script1_javascript.js, I have:
function hello() {
alert('Hello');
}
In script2_jquery.js, I call the function:
hello();
Why don't I get "Hello" when I view my page? The shortcode is activated. I've got the shortcode on a page. I wp_enqueued script2 after script1. Will WordPress allow me to call a function from another script? Any suggestion on what's going on or how to fix it?
Thank you.