On my site, I load a jQuery UI script using the following code:
wp_enqueue_script('nf-jquery-ui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js')
In my plugin, I use the following code:
wp_enqueue_script('wp_filebrowser-jqueryui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js')
As a result, both of these lines are added to my header - and loading the script twice is not very good.
Yes, I know that I can remove it from my plugin or my site. But the fact is, everyone can download my plugin, and they can already load the jQuery UI script.
How can I avoid adding a script?
source
share