Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery.js"></script>... ( several lines lower ) ... <script type="text/javascript" src="/misc/jquery.js?n"></script>... ( several lines lower, getting to my code ) ...<script type="text/javascript" src="/sites/all/themes/fairvotemn/js/superfish.js?n"></script><script type="text/javascript"><!--//--><![CDATA[//><!-- $(document).ready(function(){ $("ul.sf-menu").superfish(); }); //--><!]]></script>
function load_my_library() { static $loaded; if (empty($loaded)) { $loaded = TRUE; ... get the path to my library drupal_add_js($path_to_my_library, 'module); }}
For what it's worth I think that the idea of using a separate version of jquery for CiviCRM & the cj reference is the way to go. The idea of trying to share versions with different apps is terrifyingly reminiscent of java - arrghh.
Is there a way to make exceptions to CiviCRM Javascript loading: "Don't load CiviCRM Javascript on the following pages..." much the way through Drupal we can elect to NOT load certain Blocks on certain nodes?
for (var i in scripts) {var src = scripts[i];if (src.match('/misc/jquery.js')) {civicrm.addedJS[src] = true;}if (!$('script[src='+ src + ']').length && !civicrm.addedJS[src]) {
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery.js"></script><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-ui.js"></script><style type="text/css">@import url(/sites/all/modules/civicrm/packages/jquery/css/jquery-ui.css);</style><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/flexigrid.js"></script><style type="text/css">@import url(/sites/all/modules/civicrm/packages/jquery/css/flexigrid.css);</style><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.autocomplete.js"></script><style type="text/css">@import url(/sites/all/modules/civicrm/packages/jquery/css/jquery.autocomplete.css);</style><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.chainedSelects.js"></script><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.treeview.min.js"></script><script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.bgiframe.pack.js"></script><script type="text/javascript" src="/sites/all/modules/civicrm/packages/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>