开发者

jQuery 1.4 no conflict with jquery ui and drupal 6

开发者 https://www.devze.com 2023-02-16 04:16 出处:网络
I am implementing a little survey prompter / reminder tool that is being implemented in a Drupal 6 website environment that contains various ColdFusion and static html pages. I am attempting to use jQ

I am implementing a little survey prompter / reminder tool that is being implemented in a Drupal 6 website environment that contains various ColdFusion and static html pages. I am attempting to use jQuery 1.4.4 with Drupal's version of 1.2.6.

I am importing jQuery 1.4.4 like this:

<code>
<script type="text/javascript" src="/misc/jquery.js?7"></script> 
<script type="text/javascript" src="/misc/drupal.js?7"></script> 
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox.js?7"></script> 
<script type="text/javascript" src="/sites/all/modules/poormanscron/poormanscron.js?7"></script> 
<script type="text/javascript" src="/sites/all/themes/realdecoy/scripts/jquery.carousel.js?7"></script> 
<script type="text/javascript" src="/sites/all/themes/realdecoy/scripts/jquery.superbox-min.js?7"></script> 
<script type="text/javascript" src="/sites/all/themes/reald开发者_C百科ecoy/scripts/swfobject.js?7"></script> 

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script>
  <script type="text/javascript" src="/_inc/survey/jquery.cookie.js"></script>
  <!-- this script starts with : var j144 = jQuery.noConflict() : which I believe should restore $ to the jQuery 1.2.6 instance -->
  <!-- this then sets up numerous behaviors using the j144 instance -->
  <script type="text/javascript" src="/_inc/survey/survey.js"></script>
</code>

Now what should (and does happen when I do not have 1.2.6 i.e., no noConflict to deal with) the user will load the page, and be asked about participating in a survey at the end of their visit. Subsequently using cookies the users behavior is somewhat monitored to detect when they leave the site (i.e., navigate to a page, or click an external link). Like I said, this all works correctly, and I have performed testing on this, when I am working on a ColdFusion script and do not have to use noConflict to allow Drupal's jQuery to co exist. Now, it does not malfunction completely with noConflict, however the entire process is very buggy and does not flow consistently.

Does anyone have any suggestions about how to go about finding where the problem is? I've made several small edits to some of the plugins being loaded after I load jQuery 1.4, and I've juggled the code


Are you sure you can't just upgrade Drupal's 1.2.6 version? It also seems like a waste of bandwidth/cpu/rainforests to be loading two separate jquery versions.

So far jQuery versions have mostly been backwards compatible. Adding features more than removing them.

0

精彩评论

暂无评论...
验证码 换一张
取 消