I am using the jQuery cluetip plugin in a portal environment where there can be more than one instance of a portlet on a portal page. Each portlet is its own app, so it really knows nothing about the other portlets. Each portlet needs to use the cluetip plugin, so it is loading it when it needs it. The problem is that, when the cluetip script is loaded more than once, it generates the following error:
$cluetip is undefined
I know one possible solution is to check whether the plugin is already loaded or not, but every check I have tried fails. I have tried:
if(jQuery.cluetip), if(jQuery().cluetip), if(jQuery.fn.cluetip), if(jQuery().fn.cluetip)
and none of them work. They all return undefined.
How can I check whether the plugin is already loaded or not? Or, is there another solution that I can implement?