Hi. I'm using Pixture Reloaded with no problem in Firefox and Midora (Webkit-based browser). But, when I try to load the same site in IE6, I get a "'jQuery' is undefined" error on line 25, which is the line in the head that calls jQuery.extend().

I found a report of this same issue in the Salamander theme: http://drupal.org/node/170590 and http://drupal.org/node/170579 . The latter recommends adding drupal_add_js('jQuery.js', ...) or similar to page.tpl.php, but that doesn't seem to help, since it just adds a

, which is already present. Outside of Drupal, people who report this problem sometimes suggest running jQuery.noconflict(), but I haven't tried this or worked out the details yet. Thanks, Andrew.

Comments

Jeff Burnz’s picture

Assigned: Unassigned » Jeff Burnz

I'm trying to recreate it but I can't on a default install (http://drupalstaging.com/pixture2/)

Do you have a link to your installation? Any other JS stuff going on etc?

I'll read those other threads, any thing else you might think might be a contributing factor?

Andrew Schulman’s picture

Status: Active » Closed (fixed)

OK, I found the reason. I had inserted a <base> tag that turned out to be bad, and that was confusing IE.

So this is not a defect in pixture_reloaded. Sorry for the noise.

Andrew.

Andrew Schulman’s picture

Title: "jQuery is undefined" in IE » "jQuery is undefined" in IE6
Project: jQuery Update » Pixture Reloaded
Version: 6.x-1.1 » 6.x-3.0
Priority: Major » Normal

For the archive: This was also caused by the infamous IE6 digest authentication bug. The bug and fix are described in #128962: HTTP 400 - BAD REQUEST - (A resolution).

Jeff Burnz’s picture

Thanks for the feedback, this may be helpful for other users. I appreciate the time you took to come back and post about this.

xjessie007’s picture

Title: "jQuery is undefined" in IE6 » "jQuery is undefined" in IE

I am having the same issue. In my case, the problem seems to be that Drupal does not forward the js file to the browser, but I do not know how to fix it.

This is what I get in Explorer 8.

Message: 'jQuery' is undefined
Line: 30
Char: 1
Code: 0
URI: http://localhost/Excel

When I look on line 30, it says:

<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/" });
//--><!]]>

This is how the jquery.js file is called in the web page code

<script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.js?o"></script>

When I attempt to go to the http://localhost/sites/all/modules/jquery_update/replace/jquery.js page, I get error 403. My filesystem download method is set to private (I am not sure if that relates to it). Would anyone have any idea how to fix this, please? I am runnind Drupal 6.19.

Jeff Burnz’s picture

Project: Pixture Reloaded » jQuery Update
Version: 6.x-3.0 » 6.x-1.1

Shifting this over to the Jquery Update queue, see if you can get some feedback there - sorry, I can't answer your question directly.

I don't know which version you are using so I am guessing :)

xjessie007’s picture

Status: Needs review » Closed (fixed)

Thanks. I am using jQuery Update 6.x-1.1 and jQuery 1.2.6.

I have a new finding. When the jQuery Update 6.x-1.1 module is disabled, jQuery is referenced as follows:

 <script type="text/javascript" src="/misc/jquery.js?o"></script>

and no error msg appears. Then, when the jQuery Update 6.x-1.1 module is enabled, jQuery is referenced as follows:

<script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.js?o"></script>

and I get the "jQuery is undefined" error message. I am not sure what to do. Should I copy the /sites/all/modules/jquery_update/replace/jquery.js file over the /misc/jquery.js file, disable the jquery update module and leave it that way? (Sorry for a stupid question, do I need jquery at all? I installed the jquery update module just because I saw a message on the website status page that I should do it, but I do not see any difference in the site functionality (except the error message) with or without the module.)

xjessie007’s picture

Status: Closed (fixed) » Needs review
agileware’s picture

Priority: Normal » Major
Status: Closed (fixed) » Active

I'm seeing this as well. I will investigate and see if I can find the source.

Also, I'm using 6.x-2.0-alpha1 so it doesn't just affect 6.x-1.1

Also, this seems to only affect IE versions less than 8.

agileware’s picture

My issue seems to have been solved by using the regular version of the jquery file instead of the minified version.

Not ideal but if it fixes the problem it's not the end of the world.

agileware’s picture

Title: "jQuery is undefined" in IE6 » "jQuery is undefined" in IE
Project: Pixture Reloaded » jQuery Update
Version: 6.x-3.0 » 6.x-2.0-alpha1
Priority: Normal » Major

Scratch that last one, it actually seems to have been fixed by turning off javascript aggregation (regardless of using minified or development jQuery), which is definitely not ideal but at least for now it is working for me.

stmathew’s picture

Put jquery script tags before any .js script tags that use jquery. This will fix the IE error. Although Firefox does not complain - the included js files fail gracefully.

agileware’s picture

Thanks for the tip.
But if everything comes from the $scripts variable and drupal_add_js() doesn't have a weight option in drupal 6 how can you make sure (I would assume drupals js system would already handle adding jquery first for within the $scripts variable).
I'll also double check for any scripts outside of the $scripts variable.

centas’s picture

had same issue with version 6.x-1.1, solved by suggestion of Agileware: disabled the javascript aggregation.
unfortunately Drupal is not very friendlu with jQuery.

jnettik’s picture

I'm having this same problem. Problem is if I disable the aggregation, my page won't load at all in ie8 and below. I think that has to do with IE's script limit, correct?

caspercash’s picture

i am also experiencing this kind of problem in IE when the highslide js functionality is enabled. works great in FF and chrome but unfortunately in IE, it doesn't work at all.. the js error 'jQuery' is undefined still appears. I think there is some conflict with the jQuery and highslide.js in IE. But mysteriously, it doesn't have any problem on other browsers except IE. any ideas?

splitsplitsplit’s picture

I had this problem. My problem was how I was calling the JS.

Adding the JS to my theme like this:

drupal_add_js('sites/all/themes/mytheme/facetaccordians.js', 'file');

Worked fine. However I wanted it to be conditional so modern browsers didn't have to have an extra JS file. The only way I managed to get this was adding the stylesheet straight into the html.php file.

The following was also suggested somewhere, however this caused the undefined problem.

$ie6minheight = array(
  '#tag' => 'script',
  '#attributes' => array( // Set up an array of attributes inside the tag
    'type' => "text/javascript",
    'src' => "http://mysite/sites/all/themes/mytheme/ie6minheight.js",
  ),
  '#prefix' => '<!--[if lte IE 7]>',
  '#suffix' => '</script><![endif]-->', 
);
drupal_add_html_head($ie6minheight, 'ie6minheight');
markhalliwell’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

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