I'm trying to get jquery_update working in my site, but it's not; not quite anyway. The problem looks a lot like what I've found posted by people claiming problems with admin_menu that were traced to lightbox2 (I think), but it's not quite the same, and I'm not running lightbox of any form. So:

I'm running Drupal 6.19 and jquery_update 6.x-2.x-dev; all my other modules are up to date. Most of my pages don't do any jquery, but one of them is using a bit of third-party jquery code (a small pop-up menu thing) which requires 1.3.2). When I load that page, Firefox reports "$ is not a function" errors for admin_menu.js (line 3) and misc/textarea.js( (line 4), both of which are just the first use of a jquery-type $(...) statement. The pop-up code does not work, but, oddly enough, admin_menu is working fine. In case it's useful, the page being loaded looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Site Name | Page Name</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/images/sitename.ico" type="image/x-icon" />
    <link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin_menu/admin_menu.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_friend/vr_friend.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_message/vr_message.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_slate/vr_slate.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?t" />

<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/filefield/filefield.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fivestar/css/fivestar.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/files/fivestar/basic/basic.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/logintoboggan/logintoboggan.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/js/popupmenu/popupmenu.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/themes/vr/style.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/themes/vr/vr-layout.css?t" />
    <script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?t"></script>
<script type="text/javascript" src="/misc/drupal.js?t"></script>

<script type="text/javascript" src="/js/vr.js?1289686414"></script>
<script type="text/javascript" src="/js/dw.js?t"></script>
<script type="text/javascript" src="/js/confirmation.js?t"></script>
<script type="text/javascript" src="/js/css_browser_selector.js?t"></script>
<script type="text/javascript" src="/vrincludes/mediaplayer/swfobject.js?t"></script>
<script type="text/javascript" defer="defer" src="/sites/all/modules/admin_menu/admin_menu.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.js?t"></script>
<script type="text/javascript" src="/js/popupmenu/popupmenu.js?t"></script>

<script type="text/javascript" src="/js/expandoText.js?t"></script>
<script type="text/javascript" src="/misc/textarea.js?t"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1 }, "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." }, "user_relationships_ui": { "loadingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/loadingAnimation.gif", "savingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/savingimage.gif", "position": { "position": "absolute", "left": "0", "top": "0" } } });
//--><!]]>
</script>
...rest of page...

(Modules starting with vr_ are mine; the third-party code is /js/popupmenu/popupmenu.css.)

OK, so some third-party code isn't working; hardly your fault, I guess. But here's what's weird: If I modify the code that generates this page to explicitly load the SAME jquery code that jquery_update loads, all is well -- Firefox reports no errors, admin_menu and textarea work fine, and my code does, too. I did this like so --

drupal_add_js('sites/all/modules/jquery_update/replace/jquery.min.js');

and the resulting page code looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Site name | Page name</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/images/sitename.ico" type="image/x-icon" />
    <link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin_menu/admin_menu.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_friend/vr_friend.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_message/vr_message.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/modules/vr_slate/vr_slate.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?t" />

<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/filefield/filefield.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fivestar/css/fivestar.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/files/fivestar/basic/basic.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/logintoboggan/logintoboggan.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/js/popupmenu/popupmenu.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/themes/vr/style.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/themes/vr/vr-layout.css?t" />
    <script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?t"></script>
<script type="text/javascript" src="/misc/drupal.js?t"></script>

<script type="text/javascript" src="/js/vr.js?1289686718"></script>
<script type="text/javascript" src="/js/dw.js?t"></script>
<script type="text/javascript" src="/js/confirmation.js?t"></script>
<script type="text/javascript" src="/js/css_browser_selector.js?t"></script>
<script type="text/javascript" src="/vrincludes/mediaplayer/swfobject.js?t"></script>
<script type="text/javascript" defer="defer" src="/sites/all/modules/admin_menu/admin_menu.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.js?t"></script>
<b><script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?t"></script></b>

<script type="text/javascript" src="/js/popupmenu/popupmenu.js?t"></script>
<script type="text/javascript" src="/js/expandoText.js?t"></script>
<script type="text/javascript" src="/misc/textarea.js?t"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1 }, "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." }, "user_relationships_ui": { "loadingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/loadingAnimation.gif", "savingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/savingimage.gif", "position": { "position": "absolute", "left": "0", "top": "0" } } });
//--><!]]>
</script>
... more page code ...

It's clear that sites/all/modules/jquery_update/replace/jquery.min.js is getting loaded twice, which makes me think that something after the first load is screwing things up. But what it is, I have no idea. I must confess to being something of a jquery newbie, so I haven't had much luck with diagnosing that code.

Anyway, I guess I have my workaround, but this in general doesn't seem right. Do any of you folks have any insights into this? Thanks!

Comments

markhalliwell’s picture

Status: Active » Closed (outdated)

Drupal 6 reached EOL (end-of-life) on February 24, 2016.