Drupal site - jquery doesn't work on search results page
My custom jquery functions don't work on "search results" page and on "add material" page开发者_JS百科.
Pages urls are next:
mysite/search/node/ - search results
mysite/node/add - add material
So it seems, that when some modules run, my jquery functions are disabled. When I add a material - this bug is seen only by me, but every visitor of my site will be able to see search results. :(
Simple JS function works fine: I checked it with alert().
Any ideas, why does it happen? Thanks.
P.S. I have 2 jquery versions. May be, this fact is important. I manage them as follows:
<script type="text/javascript" src="<?=path_to_theme()?>/js/jquery.1.6.1.js"></script>
<script type="text/javascript">var $j = jQuery.noConflict();</script>
<?php print $scripts ?>
The problem might be due to the fact that you must use jQuery.noConflict() before loading the other library. Read this article for some tips on loading two version of jquery.
Maybe just switch the lines:
<script type="text/javascript">var $j = jQuery.noConflict();</script>
<script type="text/javascript" src="<?=path_to_theme()?>/js/jquery.1.6.1.js"></script>
<?php print $scripts ?>
I've removed my integrated version and have leaved only core version of jQuery. All work fine. I think it's not a question anymore, but bug report. And it seems, that the bug is in drupal, cause on simple pages .noConflict() worked perfectly.
An advise to those, who has the same problem - use only core version and rewrite your scripts, if needed. Or you can also make some update with this module (Thanks to hross for the link)
精彩评论