Developing a plugin that uses Twitter's Bootstrap Modals, but would like to prevent loading bootstrap if it's already loaded.
Apparently the following .js code could do the trick:
<script> if(typeof($.fn.modal) === 'undefined') {document.write('<script src="//www.mysite.com/js/v/bootstrap-2.1.1.js"><\/script>')}</script>
But is there any way of doing it with php, or otherwise preventing the plugin from encoding the script if it's already present?