Hi,

I have just installed a clean Drupal 7 and also CKEditor. The textareas are not converting to Rich Text (with all the buttons etc) and the FireFox error console gives:

Error: JQuery is not defined

I have also tried uninstalling CKEditor and installing WYSIWYG and the ckeditor.js files but it too gives the same error. I am therefore thinking that both of these modules need JQuery in order to work but it is correctly installed.

How do I install JQuery? Why is it erroring?

Thanks

Comments

nevets’s picture

jQuery is part of core so need to install. I have not tried any of the editors with D7 but looking at the issue queue others have experience problems also. I would start by using firebug to see if I could determine what code was producing the error.

crabsoul’s picture

I am having the same problem with "drupal_json_output" function. In firbug, I am getting error:
Jquery is not defined.

Any idea whats causing this?

Thanks
Rash

nevets’s picture

What does you code look like?

ssg13565’s picture

I have just installed Apache on my local host. After days of pulling my hair out, I can finally access the home page of my Drupal site and getting the mod-rewrite to work using virtual hosts.

There is no theme applied to the page, however.

In firebug, I get

jQuery is not defined
[Break On This Error] jQuery.extend(Drupal.settings, {"baseP...re_reloaded\/custom.css":1,"0":1}}});

The full beginning of the line is actually:

jQuery.extend(Drupal.settings, {"basePath":"\/SturbridgeLibraryFriends.org\/","ajaxPageState":{"theme":"pixture_reloaded","theme_token":"

A few lines before the failing line, the page links the following file:

http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/js...

The beginning of that file is:

// $Id: jquery.js,v 1.20 2010/11/12 01:36:08 webchick Exp $
/*!
* jQuery JavaScript Library v1.4.4

The code from the top to the failing line, according to firebug is:

1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">
2 <html lang="en" dir="ltr" version="HTML+RDFa 1.1"
3 xmlns:content="http://purl.org/rss/1.0/modules/content/"
4 xmlns:dc="http://purl.org/dc/terms/"
5 xmlns:foaf="http://xmlns.com/foaf/0.1/"
6 xmlns:og="http://ogp.me/ns#"
7 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
8 xmlns:sioc="http://rdfs.org/sioc/ns#"
9 xmlns:sioct="http://rdfs.org/sioc/types#"
10 xmlns:skos="http://www.w3.org/2004/02/skos/core#"
11 xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
12 <head profile="http://www.w3.org/1999/xhtml/vocab">
13 <meta charset="utf-8" />
14 <meta about="/www.sturbridgelibraryfriends.org/node/2" property="sioc:num_replies" content="0" datatype="xsd:integer" />
15 <link rel="shortcut icon" href="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/jh..." type="image/jpeg" />
16 <meta content="Home" about="/www.sturbridgelibraryfriends.org/node/2" property="dc:title" />
17 <link rel="shortlink" href="/www.sturbridgelibraryfriends.org/node/2" />
18 <meta name="Generator" content="Drupal 7 (http://drupal.org)" />
19 <link rel="canonical" href="/www.sturbridgelibraryfriends.org/node/2" />
20 <title>Home | Friends Of Joshua Hyde Public Library</title>
21 <link type="text/css" rel="stylesheet" href="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/cs..." media="all" />
22 <link type="text/css" rel="stylesheet" href="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/cs..." media="all" />
23 <link type="text/css" rel="stylesheet" href="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/cs..." media="all" />
24 <link type="text/css" rel="stylesheet" href="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/cs..." media="all" />
25 <style type="text/css" media="all">
26 <!--/*--><![CDATA[/*><!--*/
27 div.container{width:95%;}
28
29 /*]]>*/-->
30 </style>
31 <script type="text/javascript" src="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/js..."></script>
32 <script type="text/javascript" src="http://localhost/www.sturbridgelibraryfriends.org/sites/default/files/js..."></script>
33 <script type="text/javascript">
34 <!--//--><![CDATA[//><!--
35 jQuery.extend(Drupal.settings, {"basePath":"\/www.sturbridgelibraryfriends.org\/","ajaxPageState":{"theme":"pixture_reloaded","theme_token":"XmIsvzdOwxAfG8kvTWvJdKZdXZbvwFyu8H5qg2hPAeg","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"sites\/all\/themes\/adaptivetheme\/adaptivetheme\/js\/at.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,"modules\/book\/book.css":1,"modules\/comment\/comment.css":1,"modules\/field\/theme\/field.css":1,"modules\/node\/node.css":1,"modules\/poll\/poll.css":1,"modules\/search\/search.css":1,"modules\/user\/user.css":1,"sites\/all\/modules\/ckeditor\/ckeditor.css":1,"sites\/all\/modules\/ctools\/css\/ctools.css":1,"sites\/all\/themes\/adaptivetheme\/adaptivetheme\/css\/base.css":1,"sites\/all\/themes\/adaptivetheme\/adaptivetheme\/css\/edit-links.css":1,"sites\/all\/themes\/adaptivetheme\/adaptivetheme\/css\/layout.css":1,"sites\/all\/themes\/adaptivetheme\/adaptivetheme\/css\/messages.css":1,"sites\/all\/themes\/pixture_reloaded\/admin-section.css":1,"sites\/all\/themes\/pixture_reloaded\/forms.css":1,"sites\/all\/themes\/pixture_reloaded\/tables.css":1,"sites\/all\/themes\/pixture_reloaded\/gpanels-fluid.css":1,"sites\/all\/themes\/pixture_reloaded\/colors.css":1,"sites\/all\/themes\/pixture_reloaded\/pr.css":1,"sites\/all\/themes\/pixture_reloaded\/custom.css":1,"0":1}}});

When I used Apache alias instead of virtual host, I did get themes, but mod_rewrite was not working. I fixed a bazillion things between these to trials, so there is no telling what fixed one problem and caused another.

ssg13565’s picture

I find that Apache has very flaky performance with the generated names of the cache files.

I can try to access one of the localhost cache files directly from the browser URL address line.

I can change a single letter in one of the file names that Apache cannot find, and then it can find it. I have tried to generate long file names, file names with dashes in them, and I cannot get Apache to fail. But the Drupal named cache files cause trouble.

Of course, when I change a letter in the URL, I also rename the file to match.

ssg13565’s picture

Myself,

Duh!!! If I am having problems with the cache files, turn off caching.

In Development >> Performance
Turn off Cache pages for anonymous users, Cache blocks, Compress cached pages., Aggregate
and compress CSS files., Aggregate JavaScript files.

Suddenly my site starts working.

tomas.teicher’s picture

thank you very much
this solution works for me
Tomas

nsetru’s picture

Thanks. New to drupal. Been banging head for past 3 days.

Turning off cache settings fixed issue. Cheers...

gausarts’s picture

I had this issue before. In my case I placed the scripts right before the closing </body> tag as YSlow recommended. But some modules put their scripts into $page_bottom, earlier than jQuery. Placing the scripts right before $page_bottom solved the issue.

Not work:

  <?php print $page_bottom; ?>
  <?php $add_script_to_footer && print $scripts; // here jQuery not defined ?>
</body>
</html>

Work:

  <?php $add_script_to_footer && print $scripts; // here at lowest, otherwise CKeditor not defined ?>
  <?php print $page_bottom; ?>
</body>
</html>

love, light n laughter

digibrill’s picture

Exactly worked for me.

digibrill tic

huslabs’s picture

Awesome !
You really saved my day ..

phandolin’s picture

Thank you! This was my problem as well. Really appreciate the detailed info.

interdruper’s picture

(e.g. for avoiding Google PageSpeed penalties), find the modules that fire the exception and try to remove the 'scope' => 'footer' part from the drupal_add_js() calls.

-dom-’s picture

Had this issue on a dev site and it turned out that files directory did not exist.