I'm trying to build a plugin in wordpress, and I've encountered this issue where I need to include a .js from another plugin into my own. I tried it using wp_enqueue_script() by adding the other .js as a dependency for my .js, but to no avail.
wp_enqueue_script('parent-script', '/parent-script.js', array('jquery', 'parent-script'), false); wp_enqueue_script('child-script', '/child-script.js', array('jquery', 'parent-script'), false);
I need to call a variable from the parent-script and use it in the child-script. Is it possible? If so, how do I proceed with it?