I have recently installed the timeline module and applied the patch from JS Warning. I have also followed the instructions on the correct way to setup a view for timeline. Sadly, still no success.

Firebug is telling me that jQuery is undefined and the following are errors I'm recieving in IE:

Message: 'jQuery' is null or not an object
Line: 61
Char: 1
Code: 0
URI: http://localhost:8082/timeline-test

Message: 'jQuery.support' is null or not an object
Line: 382
Char: 3
Code: 0
URI: http://localhost:8082/misc/drupal.js?m86i9m

Any help, or a point in a right direction would be greatly appreciated.

Comments

rallycivic’s picture

I have a similar problem here - this is what Chromium's Java console shows:

Uncaught TypeError: Cannot call method 'extend' of undefined                    timeline:92
(anonymous function)                                                timeline:92

Uncaught TypeError: Cannot read property 'support' of undefined               drupal.js:382
Drupal.theme.placeholder                              drupal.js:382
b.extend.ready                                   jquery.js:30
u                                                    jquery.js:38
rallycivic’s picture

The file /sites/all/modules/timeline/js/local.js contains the following:

/*
 * TODO: - needs basepath.
 *       - when including locally. everything gets included nicely. but unfortunately it throws and err
 *         that "jQuery" is undefined. It looks like that because of including it locally it delays 
 *         jquery. Wierd thing.
 */
//var Timeline_ajax_url='http://timeline-2/sites/all/libraries/simile_timeline/timeline_ajax/simile-ajax-api.js?bundle=true';
//var Timeline_urlPrefix='http://timeline-2/sites/all/libraries/simile_timeline/timeline_js/';


// shouldn't be required
//var SimileAjax_urlPrefix='/sites/all/libraries/simile_timeline/timeline_ajax/';
//var Timeline_parameters='timeline-use-local-resources=true';

The last two lines were in the Drupal 6 version, and the comments added since suggest this problem is known when using a local simile_timeline library. Are the other two lines a way of using a remote one?

polskikrol’s picture

Noticing similar issues..

[11:44:23.047] TypeError: jQuery is not a function @ sites/default/files/js/js_5vYGWSJ10mUdC94NvsP2UajJdMXxM14plOPR183ZKl8.js:6
[11:44:23.054] TypeError: jQuery is undefined @ /history:34
[11:44:23.654] TypeError: jQuery is not a function @ /sites/default/files/js/js_VWVdzNNqSAIPLJ-2EM51YarABxaHYLpVArahrE1ILQ8.js:8

ppblaauw’s picture

Also getting the javascript errors
timeline module: 7.x-3.x-dev tar.gz (28.89 KB) | zip (39.9 KB) 2012-Nov-22)
Drupal: 7.19
Libraries from: http://code.google.com/p/simile-widgets/downloads/detail?name=timeline_l...

Uncaught TypeError: Cannot call method 'extend' of undefined timeline:72

The code is like:

jQuery.extend(
Drupal.settings, {
"basePath":"\/","pathPrefix":"","ajaxPageState":{
"theme":"bartik",
"theme_token":"9aNMRJSCFbTJLnpt85eeGpwH0dZPMo8hcD8e7K-bZ38",
"js":{
"sites\/all\/modules\/jquery_update\/replace\/jquery\/1.8\/jquery.min.js":1,
"misc\/jquery.once.js":1,
"misc\/drupal.js":1,
"sites\/all\/modules\/jquery_update\/replace\/ui\/ui\/minified\/jquery.ui.core.min.js":1,
"sites\/all\/modules\/views\/js\/views-contextual.js":1,
"misc\/jquery.ba-bbq.js":1,
"modules\/overlay\/overlay-parent.js":1,
"modules\/contextual\/contextual.js":1,
"sites\/all\/modules\/admin_menu\/admin_menu.js":1,
"sites\/all\/modules\/admin_menu\/admin_menu_toolbar\/admin_menu_toolbar.js":1,
"sites\/all\/modules\/devel\/devel_krumo_path.js":1,
"0":1,
"sites\/all\/libraries\/simile_timeline\/timeline_js\/timeline-api.js":1,
"sites\/all\/modules\/timeline\/js\/timeline.js":1},
"css":............

Uncaught TypeError: Cannot read property 'support' of undefined drupal.js:403

Any thoughts what this could be related to?
order of javascripts?
wrong timeline libraries?

eclecto’s picture

This problem seems to stem from using a module or theme template file that places your script tags outside the head (e.g. at the bottom of the page). The Timeline library adds new script tags to the DOM dynamically as the plugin loads, appending them to the head and possibly making them run without some of their dependent variables, like jQuery, being defined. Thus the errors.

I tried hacking the simile ajax files ([library path]/simile_timeline/timeline_js/timeline-api.js and [library path]/simile_timeline/timeline_ajax/simile-ajax-api.js) so the new script tags would be inserted after the last existing script tag, wherever it might be, but the timeline still didn't load; some script still must be appearing in the wrong order but I haven't isolated it. The only way thus far I've found to get the plugin to work was to revert my html.tpl.php file so Drupal's scripts appear in their default place inside the head tag.

Frankly, the cleanest solution may be to find a way to skip this third-party "ajaxing" (I think it's actually pseudo-ajaxing because it's loading files asynchronously by injecting them into the DOM instead of making an actual ajax request) and just load all the necessary javascript the normal way with drupal_add_js(), page load time be darned.

eclecto’s picture

On second thought, the specific problem posted here, that of jQuery not being recognized, is probably related to #1877576: What I did to get timeline to work in Drupal 7.17. The problem I mentioned in #5 may need its own issue.