I have created a custom theme in Drupal. When the code runs on the server jQuery is not being added to the page so I am getting errors such as:
'jQuery' is undefined
I thought jQuery was updated to the page automatically? How can I go about seeing why jQUery has not been added?
Update The code works on my local machine but not the test server.
The two missing files are:
<script type="text/javascript" src="http://localhost:2013/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://localhost:2013/misc/jquery.once.js?v=1.2"></script>
When I pull the code from the server and restore locally I get the same problem. If I run drush cc all
then it starts working again and the script reference appears.
The header section of my contains the following scripts:
<script type="text/javascript" src="http://mysite.com/misc/drupal.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/misc/jquery.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/misc/jquery.once.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/sites/default/files/languages/nl_c9aC92_wtuULa79-hTFcGPM53oqk1yKwciOa_Q3yO28.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/sites/all/modules/lang_dropdown/msdropdown/jquery.dd.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/sites/all/modules/lang_dropdown/lang_dropdown.js?mqdxrf"></script>
<script type="text/javascript" src="http://mysite.com/sites/all/modules/devel/devel_krumo_path.js?mqdxrf"></script>
$scripts
in your version of html.tpl.php? Are you implementhook_js_alter()
in your custom theme? Do you have any other custom logic that might affect either the<head>
tags or JS in general?<?php print $scripts; ?>
in html.tpl.php. It is working on my local machine but not in test. Very strange... (no to the other two questions)